I have a challenge that I can not find an answer through any normal means. I want to do as much as possible in a single question because my only other option is to make this function foreach loop with scripts and countless sub-questions.
OK, so I have a MySQL server, it has the following columns: Key, UserID, Datetime and status status can be "Start", "Login" and "End".
Let me start with "login", "login" and "end" for each login event. Does anyone have the idea of a SQL query that I can use? I think this is something to do with a query within the query, but I can only get JOIN?
I agree that I will select the "beginning" event and then for every "start" event it should be seen after the "User Id" (after the "start" time, but next to "UserID" It will be important to filter the "login" or "end" events that occur after the "start" event in the future (DATE_SUB) to find out the difference for the next login event for the next login event, if not so Have happened
If someone will save me, I would be very grateful to be in Excel because then I can avoid feeling very dirty with thousands of vlookups. I'm thinking of doing this in PHP or Pearl and only 1 Creating a loop with the LIMIT 1 SQL statement, but it can create thousands of SQL queries compared to a decent SQL Selection statement. I'm not sure about MySQL in MS SQL Server I'll try something like the following:
/ P>
select key, user id, datetime, position, (date time - (Select Max from date time) table & gt; t1 WHERE t1 UserID = UserID and t1.DateTime & lt ; DateTime)) from FIFAOLSTEvent & lt; Table & gt; I have not really tried to do this, but this is what I start with. This is an additional field with the table & lt; Table & gt; should select all the columns in which the current time difference of the current item was made prior to the current item for the user items for the youngest item.
Comments
Post a Comment