i want to get col's data from a DB but i have a DISTINCT as part of the query!
i have this query :
SELECT distinct order_header.region_id,delivery.round_num FROM order_header LEFT JOIN delivery ON order_header.del_id=delivery.del_id WHERE (TAARICH_HASPAKA >=1106197200 AND TAARICH_HASPAKA <=1106344740 AND TEUDAT_MISH='') OR (TAARICH_TEUDA >=1106197200 AND TAARICH_TEUDA <=1106344740) AND delay='0' order BY order_header.region_id asc
and i cant add to "order_header.region_id,delivery.round_num " another col beacuse it will mess up the query !
so what to do? thnaks in advance peleg
I'm not sure, by try adding a group by statement at the end, something like: " group by order_header.region_id, delivery.round_num "
I think you will also have to add each additionaly table you add to the end of the group by statement as well.
what does it make the diffrence?
this is not my work, but I did manage to find an example of exactly what I want to have happen.
http://www.itc.virginia.edu/desktop/web/database/inventory/display/formatted/pickFromList.php3