我有2個查詢結合2個查詢一個查詢
Select * From wp_booking_transaction
Where DATE(launched) >= "2013-10-10" And DATE(launched) <= "2013-11-10"
And action = 1 status = 1 And type = 2 And student_id = 81569
Order by launched desc
和
Select * From wp_booking_transaction
Where (DATE(launched) >= "2013-10-10" And DATE(launched) <= "2013-11-10"
And status = 0 And type = 2 And student_id = 81569) And (action = 21 Or action = 20)
Order by launched desc
需要量:
找有有(action = 20 or action = 21)
但status = 0
action = 1
但status = 1
和行的行。
謝謝!
「和行動= 1個狀態= 1」 你確定嗎? – Strawberry