hi guys! /** i need help on sorting out the data on my MySQL. i have 2 tables on my SQL: table_products (id,name,price,discount_id) table_discount (disc_id, amount) i would like to sort the discounted price. SELECT * FROM table_products ORDER BY (price-(SELECT... blah blah WHERE disc_id=discount_id) <-- i know my SQL is wrong.. how would i do it on MySQL when not using sort() of php? i hope you guys understand.. thanks **/
In response of that; Select * from table_products tp, table_discount tds where tds.disc_id=tp.discount_id order by price); here tp, tds are alias of table table_products , table_discount Thanks and Regards, ______________________ Arun Gupta Why delete messages? Unlimited storage is just a click away. Go to http://help..yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html [Non-text portions of this message have been removed]