hi guys i was wondering if sub selects were possible in mysql 4 ? more 
specifically , whenever i do a join , i sometimes require a distinct select on 
the field in the first table and the second table may have many rows therefore 
returns the same value more than once from the first table which requires a 
distinct select for one of the fields , i was wondering if a select statement 
like this is possible ,

select distinct (t1.field1), t2.field2 from table1 t1 left join table2 t2 on 
t1.id=t2.id where t1.id=1

so therefore instead of

foo    bar1
foo    bar2
foo    bar3
foo    bar4
foo    bar5

i get

foo   bar1
      bar2
      bar3
      bar4
      bar5



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to