Sort by

recency

|

5585 Discussions

|

  • + 0 comments

    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;

  • + 0 comments
    select  concat(name, '('+substring(occupation,1,1)+')') from occupations order by name
    select 'There are a total of ',count(occupation),lower(occupation)+'s.' from occupations group by occupation order by count(occupation),occupation;
    
  • + 0 comments

    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;

  • + 0 comments

    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 ;

  • + 0 comments

    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;