Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Where Clause with VariableName

$
0
0
How can I achieve the following in SQL:

SELECT
@CURRCOLUMN,
COUNT(*)
FROM
CUSTOMERS
WHERE
@CURRCOLUMN = ""

It gives me an error. I basically need to loop through an entire tables variables to find out occurances of the column being either "" or null and return me a count of the number of occurances. This is just a small part of that task.

Viewing all articles
Browse latest Browse all 13329

Trending Articles