mysql - Query not returning expected results -
I am trying to select all my areas and join the deals in those areas ... this query 0 Returning the result, I have verified that I have data for the match that I expect to get ... Does anyone see something clearly wrong?
SELECT deal *, From the area.id area_id area, INNER JOIN account_areas ON (account_areas.account_id = 1 and account_areas.area_id = area.id) on JOIN deal (deal.area_id = area.id and deal.site_id = 1 and DAYOFYEAR (deal.created ) = DAYOFYEAR (NOW ()) and deal. Ed> = NOW () ORDER BY area.name ASC The idea is that I will call all deals for a certain area I want to draw, but if there is no deal, then the field still results in the query.
account --------------------------------- | ID | Email | --------------------------------- | 1 | Test_test.com | --------------------------------- Accounts_Arez ---------------- -------- | Account_id | Area_id | ------------------------ | 1 | 81 | 1 | 42 | ------------------------ Deals ------------------------- ------------------------------- | ID | Area_id | Title | -------------------------------------------------- ------ | 1 | 81 Test Title | -------------------------------------------------- ------ Expected Result with a Deal:
id | Area_id |
text "itemprop =" text "> < P> Use a ... left pair deal ... , if there is no deal, then all deals will be replaced by column.
Comments
Post a Comment