gpt4 book ai didi

mysql - 给MYSQL错误子查询返回多行

转载 作者:行者123 更新时间:2023-11-30 23:07:55 24 4
gpt4 key购买 nike

 SELECT j. * , w. * 
FROM tbljobseeker j
INNER JOIN tblworkexp w ON j.id = w.userid
WHERE (
w.company_name LIKE '%xoriant%'
OR w.company_name LIKE '%XORIANT%'
OR w.company_name LIKE '%Xoriant%'
OR w.company_name LIKE '%Xoriant%')
AND (
w.tomonth != 'till'
)
AND (
w.fromyear = (
SELECT w.fromyear
FROM tblworkexp
WHERE w.tomonth != 'till'
ORDER BY w.fromyear DESC
LIMIT 1 , 10 )
)
ORDER BY STR_TO_DATE( j.lastModified, '%e-%M-%Y' ) DESC , id DESC

请帮忙

最佳答案

您正在分配多个值,而预期只有一个值。

这会起作用,因为它现在会检查一个范围:

SELECT j. * , w. * 
FROM tbljobseeker j
INNER JOIN tblworkexp w ON j.id = w.userid
WHERE (
w.company_name LIKE '%xoriant%'
OR w.company_name LIKE '%XORIANT%'
OR w.company_name LIKE '%Xoriant%'
OR w.company_name LIKE '%Xoriant%')
AND (
w.tomonth != 'till'
)
AND (
w.fromyear in (
SELECT w.fromyear
FROM tblworkexp
WHERE w.tomonth != 'till'
ORDER BY w.fromyear DESC
LIMIT 1 , 10 )
)
ORDER BY STR_TO_DATE( j.lastModified, '%e-%M-%Y' ) DESC , id DESC

关于mysql - 给MYSQL错误子查询返回多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21063431/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com