How to get the latest data from this query, actually the table is crowded and we need the latest data for the past 2 years, how can I modify my query accordingly.
Select stagingScriptDB.*, testBedSuiteMapping.template from stagingScriptDB inner join testBedSuiteMapping on testBedSuiteMapping.id = stagingScriptDB.idScriptDB limit 10;
P粉4641130782023-09-16 21:16:52
It would be great if you share the table structure.
We can use this query type to retrieve the last record of id
SELECT * FROM table_name WHERE ID IN ( SELECT max(ID) FROM table_name GROUP BY column_name ORDER BY column_name )