php - Merging sql queries to get different results by date -


I am trying to create a 'Recent Events' feed and it can not seem to be true or my query It is possible how to merge the results from two queries to sort them from the date.

Plays a table, and another table holds the functions of these games /

I am trying to get recent events to show users 1) Games that are publicly visible (published) 2) When a new game has been created and published

Then, in my work table

 action id, gamid, user id , Action type, last updated 

in my game table

 gameid, start date, , Published, last updated 

I currently have such a query (simplified for easy understanding of understanding me)

  select action, actions.gameid, userid, functional work, verb. Remove from actions. (Select games.gameid, start date, createdby, published, games.lastupdate games from games published WHERE = 1 and the last update> today-2) published on actions.gameid = games.gameid where games (type 2, 4,5,6,7) and actions.lastupdate & gt; Games.lastupdate and published = 1 or games.lastupdate & gt; Today-2 and published = 1  

This question is looking for the actions of the published game where action was taken after the game was published.

However, I need to get the results of

  SELECT games.gameid, start date, Was published, published, games.stopupdate, where published = 1 and startdate & gt; Today-2  

So when I publish a new game, I can add it to the list of tasks.

When I run the query like I wrote it, I get all the actions and their gamdides, but I can not find a line that shows when publishing gemid.

I think it may be possible that I need to run two separate questions, and then somehow merge the results with PHP, but I lose it completely It has been given where to start with it.

  An AID, GID, G. Join gaming at g.gameid = g.gameid where g.published = 1 and g.lastupdate & gt; Today - 2 and one type IN (0,4,5,6,7) and a.lastupdate & gt; G.lastupdate  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -