I'm attempting to count the number of rows of a table where the date = a date in another table. The result of this query I want inserted into the row of another table where the date is equivalent to the date used to count the relevant rows to be counted.
I found this thread which is helpful: The Select Count(*) function works
However when I go to Insert the Count to the table-labeled column, there is no insertion taking place nor an error.
My actual code:
INSERT INTO "main"."LookUpWrkflwTemp" (SpiralUniverse)
SELECT Count (*)
FROM SpiralUniverse
WHERE Date = '2015-11-16';
There is a table named SpiralUniverse and a column within LookUpWrkflwTemp named SpiralUniverse.
My ultimate goal is to add a date to LookUpWrkflwTemp(Date) then perform record counts that match that date in a variety of tables and insert those values into the appropriate columns named after those tables. The above code snippet is for one column insertion and the date is hard coded.
ex. LookUpWrkflwTemp(Date,ImportDailyList,SpiralUniverse,...) is my table and columns that I want to insert record count values within the matching Date row. ImportDailyList and SpiralUniverse are the different tables where I want to search for date matching record counts.
What am I missing in the syntax in the above code snippet?
Aucun commentaire:
Enregistrer un commentaire