Home > database > [for post] have MySQL great god and have a look
[for post] have MySQL great god and have a look
Time:10-22
Now I want to do a data record database, the database table will be based on the current number of time and the last time is constantly creating form creation (30 days to create a set), Query so it has a variety of forms, but each form of data format definition is the same, one column is a datetime, After creating the more tables, the query becomes difficult for me, By querying the column definition can I find out: what created the table, but how from so many forms according to the datetime detected at the same time all other data becomes a problem, hope to be solved,
CodePudding user response:
SELECT * FROM table 1 and table 2, table 3 WHERE DATETIME> 'the 2020-09-24 09:24:59 AND DATETIME<'the 2020-10-25 09:25:20'; This way of query must be wrong, I have a small white, not too complicated grammar, hope to understand one can help me, Listed the wrong grammar is to say the simple point, probably means how like a single query table query table,
CodePudding user response:
But how from so many forms according to the datetime detected at the same time all other data becomes a problem, don't understand this sentence, check the data according to the scope of the time
CodePudding user response:
According to years to build a table, for example, table_2020_01, table_2020_02 etc., and then according to the time range in the SQL query, but in this time range may across, you see is business compromise, not across in the query, or is the time to write SQL with the union spell two tables