Yurttas/PL/DBL/postgres/F/01/Company-B/q10.sql

Revision as of 00:43, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">β†’β€ŽREM REM q10.sql REM REM Find the company with the most employees. REM: SELECT current_schema(); SET search_path ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
 1/*
 2REM
 3REM q10.sql
 4REM
 5REM Find the company with the most employees.
 6REM
 7*/
 8
 9SELECT current_schema();
10SET search_path to "companyb";
11
12SELECT companyname 
13FROM Works 
14GROUP BY companyname 
15HAVING COUNT(*) >= ALL (SELECT COUNT(*) 
16                        FROM Works 
17                        GROUP BY companyname);