brgdotnet
asked on
Storing a column count into an id
Can someone tell me how to fix this query? Basically I just want to do a select count on a column and then to store the result in a number or integer. It seems pretty simple, but I am really tired right now, so some help would be appreciated.
COUNTER INT;
SELECT COUNT ('CustomerId') INTO COUNTER FROM user_tables where table_name = 'Customers';
Here CustomerId is the column name. The query is not working as the result returned is zero.
COUNTER INT;
SELECT COUNT ('CustomerId') INTO COUNTER FROM user_tables where table_name = 'Customers';
Here CustomerId is the column name. The query is not working as the result returned is zero.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.