Your going to have to specify at least one column name to be distinct. You
can't have a wild card as the distinct or you will still get EVERYTHING in
the table. I also would caution using the '*' wild card to much, you would
be surprised at how much performance you get just by spelling out the column
names.
Your query would look like so,
<cfquery name="bookQry" ....>
SELECT DISTINCT book, id, whateverelsehere
FROM Your_Table
</cfquery>
<cfoutput query="bookQry">
#book# #bookTitle# | #text#
</cfoutput>
Make sense? Sure hope so it's early and my caffeine intake is still low at
this point... =)
-----Original Message-----
From: Tony Hicks [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 7:41 AM
To: SQL
Subject: Re: list once
Both feedbacks make sense.. can you clarify for me.. would it be
<cfquery>
Select Distinct * from #table#
</cfquery>
<cfoutput>
#book# #bookTitle# | #text#
</cfoutput>
and that would return what? Somethng like this:
1 Genesis | Text
2 Exodus | Text
3 Leviticus | Text?
----- Original Message -----
From: Bill Killillay <[EMAIL PROTECTED]>
To: SQL <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 6:36 AM
Subject: RE: list once
> If you only need to display those 66 you could use
>
> Select Distinct book, id, ....
> >From books
>
> Is that what your looking for, that would give you each book only I
> believe...
>
> -----Original Message-----
> From: Tony Hicks [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 6:39 AM
> To: SQL
> Subject: list once
>
>
> I think a similar question has been asked but..
>
> is there a way to arrange data inside <cfquery> so that it bases the where
> off 'book' and if but since there's about 300,000 rows in the db.. and
only
> about 66 values for Book, that it only displays one row for each data
>
> so that if there was
>
> 1 | Genesis | Text
> 1 | Genesis | More Text
> 1 | Genesis | Even more
> .....
> 2 | Exodus | Text
> 2 | Exodus | Even More Text
>
> it would only display
>
> 1 | Genesis | Text
> 2 | Exodus | Text
>
> Thanks,
> Tony Hicks
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists