We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Advanced Select
- The PADS
- Discussions
The PADS
The PADS
Sort by
recency
|
5585 Discussions
|
Please Login in order to post a comment
select CASE when occupation='Doctor' then CONCAT(name,'(D)') when occupation='Professor' then CONCAT(name,'(P)') when occupation='Singer' then CONCAT(name,'(S)') else CONCAT(name,'(A)') end as occ_nam from OCCUPATIONS order by name asc;
select CONCAT('There are a total of ',count(occupation),' ',LOWER(occupation),'s.') as ocurrences from OCCUPATIONS group by occupation order by count(occupation),occupation asc;
This will work- select concat(name,"(" ,left(occupation,1), ")" ) as summary from occupations union all
select concat("there are a total of " , count(*),' ' ,lower(occupation) ,"s.") as summary from occupations group by occupation order by case when summary like "there are a total%" then 2 else 1 end, summary;
select concat(name,"(",left(occupation,1),")") from occupations order by name;
select str from( select occupation,concat("There are a total of ", count(occupation)," ",lower(occupation),"s.")str from occupations group by 1 order by count(occupation),occupation)ab ;
SELECT Name || '(' || SUBSTR(Occupation, 1, 1) || ')' FROM OCCUPATIONS ORDER BY Name ASC; SELECT 'There are a total of ' || COUNT(Occupation) || ' ' || LOWER(Occupation) || 's.' FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation), Occupation;