I currently have a large database with a couple hundred thousand rows and I am trying to filter down to meet certain parameter for a new table.
I currently have the code:
SELECT sym, tstamp, COUNT(*) AS trades
FROM datas
GROUP BY sym, tstamp
HAVING COUNT(tstamp) > 300
Which gives me the filtered table that I am looking for. However I am stuck from here on how to create a new table once I have this result. I'm sure this is fairly straightforward but I have been stuck on it for a couple of hours.
This is the code I am trying to use:
"INSERT INTO newdb SELECT * FROM datas
WHERE sym, tstamp, COUNT(*) AS trades
FROM datas GROUP BY sym, tstamp
HAVING COUNT(tstamp) > 300"
question from:
https://stackoverflow.com/questions/65516750/how-to-create-a-sql-database-based-on-parameter-being-met-in-another-database 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…