[ale] any SQL gurus?

Matthew Brown matthew.brown at cordata.com
Wed Jan 21 11:19:23 EST 2004


Nahh..  No need for a sub-select on this one.  Lemme ponder. 


Matthew Brown
 	      (888) 681-2262     .     (770) 795-0089     .
http://www.cordata.com	 

	
*	Windows and Linux Networks
*	Anti-virus
*	Security
*	Email
*	Web Development & Hosting
	
*	Application Development & Hosting




-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Jason
Etheridge
Sent: Wednesday, January 21, 2004 11:04 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] any SQL gurus?

On Jan 21, 2004, at 10:39 AM, Jeff Tillotson wrote:
> Not a SQL guru but wouldn't this work:
> SELECT COPY.owner COPY.title_key TITLE.name from TITLE COPY where 
> TITLE.title_key = COPY.title_key order by COPY.owner;

On Jan 21, 2004, at 10:34 AM, Dylan Northrup wrote:
> I'm not much of a SQL guru, but wouldn't this work:
>
> select t.name from t TITLE, c COPY where c.owner = "whoever" and
> 	c.title_key = f.title_key;

Thanks guys.  Hmm.  Both of these work if I use the DISTINCT keyword.  
But for some reason, such things as DISTINCT COUNT(name) don't work, and
each copy goes toward the total.  I can't really afford to fetch all the
results and count them on the client side.  I shouldn't have used the word
"list", my mistake.

Hmm.  Looks like the inner join does the same thing--or were these other
queries already implicitly inner joins?  I really dislike databases. :-)

So it's not a list I need, but a count.  Hrmm.

I bet I need sub-selects.  Something like   SELECT COUNT(*) FROM ( 
SELECT DISTINCT )

Thanks for your help.  I'm going to keep banging my head against it.

-- Jason

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list