POV-Ray : Newsgroups : povray.off-topic : SQL question : Re: SQL question Server Time
29 Sep 2024 21:23:01 EDT (-0400)
  Re: SQL question  
From: Darren New
Date: 12 Mar 2009 12:48:17
Message: <49b93cd1$1@news.povray.org>
scott wrote:
> So I take it using SELECT DISTINCT X ... is better than using SELECT X 
> ... GROUP BY X for what I want to do?

I don't know. I'd say it's more "correct" in some abstract theoretical 
sense, since the only reason you're grouping is to get unique rows. And it 
works in the case you're trying. :-)

If you wanted to know how many different types of events each experiment 
yielded, you'd do something like
   select expid, count(eventid) from exp group by expid
or something like that. (Not gonna fire up SQL to try it.)

But you see what I'm saying there.

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.