Re: distinct - how to do

From: Date: Sat, 19 Jan 2002 17:18:01 +0000
Subject: Re: distinct - how to do
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15995@lists.php.net to get a copy of this message
At 2:28 +1300 1/20/02, Barry Rumsey wrote:
I have the following query: $query = "SELECT * FROM xp_topics, xp_stories WHERE xp_topics.topicid = xp_stories.topicid AND xp_topics.artistname='Faith Hill' ORDER BY topictext DESC LIMIT 0,20"; It returns the lot but a lot of doubles. I want to put a DISTINCT call the query, but if I put it after the select ( select distinct * from.......) it returns nothing. How do you do a DISTINCT?
That's how you do it (add DISTINCT after the SELECT keyword). You must be doing something else wrong.

« previous php.db (#15995) next »