3
Hi, I have a question if anyone can help me on SQL. I know the Group By clause, as far as I know it groups similar data. But I understand that it should group but in the script below it has the group by shows lines and without the group by it shows only one lines. He wasn’t just for grouping, I thought he’d be good for something more aesthetic!!!
Com Group By
select p.descricao
from projeto p
join depto d on p.cod_depto = d.cod_depto
join empregado e on e.cod_depto = d.cod_depto
group by p.descricao
having count(e.mat)>1;
Sem Group By
select p.descricao
from projeto p
join depto d on p.cod_depto = d.cod_depto
join empregado e on e.cod_depto = d.cod_depto
having count(e.mat)>1;
Thanks for the force, now I understand, by the way, I remembered the studies of the time of the college. I took advantage and found my old materials of the facu and I’m retracing the studies for him, I found more complete than some books, my DB teacher was the hehehheheh bug!!! Vlw!!!!
– Hugo
@Hugo if the answer has helped you, mark it as chosen so that people with similar doubt can benefit too
– Sorack