Sort by

recency

|

5547 Discussions

|

  • + 0 comments

    --Why below code is showing wrong ? select Name + CASE WHEN Occupation = 'Doctor' THEN '(D)' WHEN Occupation = 'Actor' THEN '(A)' WHEN Occupation = 'Singer' THEN '(S)' WHEN Occupation = 'Professor' THEN '(P)' ELSE '' END AS NamewithAbbrebiation from OCCUPATIONS ORDER BY Name Asc

    select 'There are a total of '+CAST(count(*) AS VARCHAR(10))+' '+Occupation+'s.' from OCCUPATIONS group by Occupation

  • + 1 comment

    SELECT CONCAT(name, '(', LEFT(occupation, 1), ')') AS output FROM OCCUPATIONS ORDER BY name asc; SELECT CONCAT('There are a total of ', COUNT(), ' ', LOWER(occupation), 's.') AS result FROM OCCUPATIONS GROUP BY occupation ORDER BY COUNT(), LOWER(occupation);

  • + 0 comments

    SELECT CONCAT(Name ,'(',LEFT(Occupation,1),')') FROM OCCUPATIONS ORDER BY Name ASC;

    SELECT CONCAT('There are a total of ',COUNT(Occupation),' ',LOWER(Occupation),'s.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation) ASC, LOWER(Occupation) ASC;

  • + 0 comments

    select concat(name, '(', left(Occupation, 1), ')') from Occupations order by name;

    select concat('There are a total of ', count(*), ' ', lower(occupation), 's.') from occupations group by occupation order by count(occupation) asc, lower(occupation) asc;

  • + 0 comments

    SELECT CONCAT(Name ,'(',LEFT(Occupation,1),')') FROM OCCUPATIONS ORDER BY Name ASC; SELECT CONCAT('There are a total of ',COUNT(Occupation),' ',LOWER(Occupation),'s.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation) ASC, LOWER(Occupation) ASC;