- Prepare
- SQL
- Advanced Select
- The PADS
- Discussions
The PADS
The PADS
+ 0 comments Not Working For (ORACLE): SELECT (NAME ||'('|| SUBSTR(OCCUPATION,1,1)|| ')' AS HEADLINE FROM OCCUPATIONS ORDER BY NAME;
SELECT 'There are a total of ' || COUNT(OCCUPATION) || ' ' || INITCAP(OCCUPATION) || 's' AS MESSAGE FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(OCCUPATION);
+ 0 comments For sql server: Select concat(Name,'(',left(Occupation,1),')') from Occupations order by Name; declare @message varchar(50); set @message = 'There are a total of';
Select concat(@message,' ',count(Occupation),' ',lower(Occupation),'s.') from Occupations group by Occupation order by count(Occupation),Occupation Asc;
+ 2 comments SELECT CONCAT ("There are total ", COUNT (OCCUPATION), " ", LOWER (OCCUPATION), "s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT (OCCUPATION), OCCUPATION; can anybody point out the mistake
+ 0 comments This is my MySQL solution, feel free to ask me any questions.
-- The first query SELECT CONCAT(NAME, '(', LEFT(OCCUPATION, 1), ')' ) AS HEADLINE FROM OCCUPATIONS ORDER BY NAME ASC; -- Prepare constantS SET @MESSAGE = 'There are a total of '; -- The second query SELECT CONCAT(@MESSAGE, COUNT(OCCUPATION), ' ', LOWER(OCCUPATION), 's.') FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(OCCUPATION);
+ 0 comments FOR ORACLE SQL CODE
select name || '('||SUBSTR(OCCUPATION,0,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;
Sort 4203 Discussions, By:
Please Login in order to post a comment