How do you write a query when 2 fields in two different tables need to be joined to sort by Example..?
Posted on 2008-10-15
I want to write this query :
select A.lead, A.date_sold,A.price,A.money,B.pay_amount,B.note_date
from TableA A, TableB B
where customerid = 1 (on both tables)
I need the info above but I need to sort the data by combining the A.date_sold and the B.note_date together so the rows are sorted by date
Another way of explaining it:
Select * from table A where customerid = 1 (the date field in this table is date_sold)
Select * from table B where customerid = 1 (the date field in this table is note_date)
I need them sorted together so the queries are in order by date.