On Aug 3, 2006, at 12:20 PM, John Siracusa wrote:
> It just literally sticks the word DISTINCT after SELECT. MySQL does a
> lot of things differently, but I wasn't aware that this was one of
> them. How does it differ in MySQL vs., say, Pg?
sorry for the delay- i've been knee deep porting some of my modules
to CPAN today
i remember a ton of differences-- but i think Rose may be immune to
some because of the way queries are built
off the top of my head pg requires all columns to be explicitly
stated in the select when distinct, order by or group by are used
ie
works on both
select * from visit;
select distinct ip_address from visit;
works on mysql , not psql
select distinct ip_address from visit order by
timestamp_created asc;
works on psql
select distinct ip_address , timestamp_created from visit order
by
timestamp_created asc;
i'm having trouble coming up with a more advanced case for this...
but essentially mysql kind of does transparent / automagic GROUP BY
when you use distinct
i'll go through my sql codes from when i migrated mysql to postgres
last year , hopefully i can find some better cases that illustrate
this in a more practical setting
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object