What are some values for col1, col2, etc for different blue cars? The same 
value for all blue cars, different?  if different, which value would you want?

It sort of sounds like you want a "group by CATEGORY", which will give you one 
row per CATEGORY value, but then you'll need to use aggregate functions (min, 
max, count, etc) for the rest of the columns in the select list (col1, col2).  
When all of the values are the same you could either use "col1 = min(col1)" (or 
"col1 = max(col1)"), or you add col1 to the "group by" statement, and then you 
don't need to aggregate the column.

If this doesn't make any sense then send back more sample data and what you 
want the select to give you.

        Mark

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 07, 2005 1:21 PM
To: CF-Talk
Subject: Stupid SQL Question


Using Access

What I need in sorta English

Select
   distinct (CATEGORY),  --- just this one distinct (red, blue, green)
   col1, col2, col3m col4  --- and these too, but ain't gotta be distinct
WHERE
   TYPE = 'myTYPE'
   order by col4


Or basically, if type is a "CAR", then show one red car, one blue car, 
one green car ... regardless of how many there actually are.

I need to do it in the SQL Select statement, not on the output side 
though...


-- 
-----------
Les Mizzell



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201931
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to