Each GROUP BY expression must contain at least one column that is not an outer reference

前端 未结 7 1755
-上瘾入骨i
-上瘾入骨i 2020-12-09 07:50

What am I doing wrong here? I am getting this error on:

SELECT LEFT(SUBSTRING(batchinfo.datapath, PATINDEX(\'%[0-9][0-9][0-9]%\', batchinfo.datapath), 8000),         


        
相关标签:
7条回答
  • 2020-12-09 08:55

    Here's a simple query to find company name who has a medicine type of A and makes more than 2.

    SELECT CNAME 
    FROM COMPANY 
    WHERE CNO IN (
        SELECT CNO 
        FROM MEDICINE 
        WHERE type='A' 
        GROUP BY CNO HAVING COUNT(type) > 2
    )
    
    0 讨论(0)
提交回复
热议问题