Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

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.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial