select * from employees
Selecting the whole table to display.
select salary from employees group by salary
It is just displaying the salary by 'group by' without repetition.
I cannot group this by that query, then tried to display two columns with group by a column.
select distinct(salary), first_name from employees where salary in (select salary from employees group by salary)
Finally, i have done. I wrote subquery to do it.
select distinct(salary) from employees where salary in (select salary from employees group by salary)
Selecting the whole table to display.
select salary from employees group by salary
It is just displaying the salary by 'group by' without repetition.
I cannot group this by that query, then tried to display two columns with group by a column.
select distinct(salary), first_name from employees where salary in (select salary from employees group by salary)
select distinct(salary) from employees where salary in (select salary from employees group by salary)
No comments:
Post a Comment