Sunday, June 5, 2016

SQL concatenation


select name ||'('|| upper(substr(occupation,1,1)) || ')'
from occupations
order by name;

select 'There are total ' || ct ,lower(occupation) ||'s.' from (
select occupation,count(*) as ct from occupations
group by occupation
order by ct,occupation
);

No comments:

Post a Comment