MySQL Union和ORDER BY

时间:2012-06-25 02:40:25

标签: mysql select union-all

(SELECT * FROM Test1 WHERE (date >= '2012-06-28'AND date < '2012-06-30') AND (Avail > '0'))
UNION 
(SELECT * FROM Test2 WHERE (date >= '2012-06-28'AND date < '2012-06-30') AND (Avail > '0'));

MySQL results

Alpha   Price        date         Avail     description
A           165.00       2012-06-28     10  Something
D           200.00       2012-06-28     10  Something
D           200.00       2012-06-29     10  Something

问题:

Alpha = A --> date 2012-06-29 Avail = 0

如何让MYSQL获得Alpha = D的结果,其中2012-06-28至2012-06-30的日期和Avail = 10.Alpha = A只有2012-06-28的Avail

0 个答案:

没有答案