mysql-error-1242

How to resolve this in Mysql (#1242 - Subquery returns more than 1 row )?

别说谁变了你拦得住时间么 提交于 2019-12-08 13:17:02
问题 I have posted 3 queries here. Actually I want to join 1st & 2nd query. As I want to have result of sc.message along with my 2nd query resultset. Just check my third query which gives above #1242 error? Plz guide me... Query1=(SELECT sc.message FROM sales_flat_order sfo, `sales_flat_order_item` `sfoi` LEFT JOIN `shipping_comment` `sc` ON `sfoi`.`shipping_comment_id` = `sc`.`shipping_comment_id` WHERE sfoi.order_id = sfo.entity_id AND sfo.increment_id = 100000429) Query2= (SELECT sfoi.name,

mysql query room availability

不问归期 提交于 2019-12-04 05:56:54
问题 Having looked at some of the other mysql availability query questions on here has got me so far, but the way mine works is slightly different to the others. Basically I have a table of dates, and each date is a row. Each row contains fields to say the cost, room type, and how many days your booking has to be to book on that date. So if a Hotel has 1 room type, it will have 365 rows, if it has 5 room types, it will have 1825 rows bd_id int(10) NO PRI NULL auto_increment bd_room_type varchar(32

Using GROUP_CONCAT on subquery in MySQL

ぃ、小莉子 提交于 2019-12-03 06:29:01
问题 I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is what it boils down to). Basically, I do something like this: SELECT *, GROUP_CONCAT((SELECT userid FROM favourites WHERE itemid = items.id) SEPARATOR ',') AS idlist FROM items WHERE

Subquery returns more than 1 row in mysql

时间秒杀一切 提交于 2019-12-02 14:34:22
问题 I am executing the following query and got the error "Subquery returns more than 1 row" My Query is SELECT pkTicketID, TicketReplyDateAdded, TIMESTAMPDIFF(DAY, TicketReplyDateAdded, now()) as NumberOfDays FROM tickets as T LEFT JOIN ticket_replies as TR ON T.fkTicketReplyID=TR.pkTicketReplyID WHERE 1 AND T.fkEmployeeID = '4' AND (SELECT TIMESTAMPDIFF(DAY, TicketReplyDateAdded, now()) as NumberOfDays FROM tickets as T LEFT JOIN ticket_replies as TR ON T.fkTicketReplyID=TR.pkTicketReplyID ) = 7

MySQL update with two subqueries

自闭症网瘾萝莉.ら 提交于 2019-12-02 09:59:53
I'm trying to update one column of MySQL table with subquery that returns a date, and another subquery for the WHERE clause. Here is it: UPDATE wtk_recur_subs_temp SET wtk_recur_date = (SELECT final_bb.date FROM final_bb, wtk_recur_subs WHERE final_bb.msisdn = wtk_recur_subs.wtk_recur_msisdn) WHERE

MySQL: Error Code: 1242 Subquery returns more than 1 row

柔情痞子 提交于 2019-12-01 13:26:08
问题 error image here SELECT daire.code, daire.durumu, daire.blblkodu, CONCAT(cari.adi , cari.soyadi) AS sahibi, CASE daire.blkrcrkodu WHEN '0' THEN CONCAT(cari.adi,cari.soyadi) ELSE (SELECT CONCAT(adi,soyadi) FROM cari WHERE blkodu = daire.blkrcrkodu AND firma_code = 40 AND site_code = 84) END AS oturan, daire.kat, daire.kapi_no, daire.giris_no, daire.alan_m2, daire.__formatted_date FROM daire INNER JOIN cari ON (daire.blshcrkodu = cari.blkodu AND cari.site_code = 84 AND daire.site_code = 84)

工具导航Map

JSON相关