adding col's to a select

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

adding col's to a select

Post by pelegk2 »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you may need multiple queries if you can't figure anything out.. if you want help with writing the query, we'll need some more info, like table structure, a set of the data stored, and the expected results (using the data stored list).
Post Reply