问题要用的表为:
company(company_name,city)
works(employee_name,street,city)
查询如下:
SELECT company_name
FROM (SELECT company_name,COUNT(employee_name)
FROM works
GROUP BY company_name) AS A(company_name,number)
WHERE number>=ALL(
SELECT number
FROM A);
执行后出现:
消息 208,级别 16,状态 1,第 1 行
对象名 'A' 无效。
问题原题是:
Find the company in the database that has the most employees.
说用with语句的就不要了,就是想知道这个查询中from子句中的重命名怎么弄