You know, sometimes you just do the dumbest things because you never bothered looking into simplifying the task. Lets say you have a table full of data and you want to retrieve all duplicates. Well this is how i used to do it.
select *
from ( select mydata, count(*) thecount
from mytable
group by mydata)
where thecount > 1;
Well thats just DUMB DUMB DUMB!!!!
I can write instead:
select mydata, count(*)
from mytable
group by mydata having count(*) > 1;
much much better!!
3 comments:
I do find this useful. I guess I'm a geek. Do I ever miss my Oracle days. ;o)
There is nothing wrong with being a geek. I have dedicated my entire life to making sure that I stay a geek. Born a geek, die a geek!
Ben, oui, mais t'avais qu'à me téléphoner, je te l'aurais donné ce truc!
Josée B.
Post a Comment