HI,
I have a simple query
Which works great, but I also want to add another field to the queryCode:SELECT DISTINCT alt, galID FROM cfm_gallery LIMIT 12
photo
But I don't want that field to be distinct, how do I do this?
Thanks
Chris
| SitePoint Sponsor |




HI,
I have a simple query
Which works great, but I also want to add another field to the queryCode:SELECT DISTINCT alt, galID FROM cfm_gallery LIMIT 12
photo
But I don't want that field to be distinct, how do I do this?
Thanks
Chris
Why don't you want the photo field to be distinct?
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget




As the galID holds different values such as 54, 55, 56
But the photo contains the filename, which is sometimes called the same thing
So?
will give you all alt-galID-photo values without duplicates.Code:SELECT DISTINCT alt, galID, photo FROM cfm_gallery LIMIT 12
galID 54 with photo 'john' and galID 55 with photo 'john' will both be selected.
If this isn't what you want, then please post an example of the data present in your table, and the result you'd like the query to have.
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget
Bookmarks