Forum Moderators: coopster

Message Too Old, No Replies

Select distinct wildcards?

is this possible?

         

jake66

2:33 am on Aug 22, 2007 (gmt 0)

10+ Year Member



2 tables of my records should be distinct. (TO and SUBJECT)

This works:

$query_raw = "SELECT distinct(to) * from " . $table_in_use . " order by to desc";

this doesn't:

$query_raw = "SELECT distinct(to,subject) * from " . $table_in_use . " order by to desc";

Is it possible to do, what I am trying to achieve?

whoisgregg

2:44 pm on Aug 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Group by can often achieve the same results as DISTINCT. See if this works for you:

$query_raw = "SELECT * from " . $table_in_use . " group by to, subject order by to desc";