Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Set a flag if certain columns contain a value

$
0
0

I have a table with multiple different columns. Each of these fields can contain 1 or 0. So how would I write a statement that sets a "flag" if each of these columns contain a 1. Again, I only want the field to be set ifeach column in the row contains a 1. I know I can use "nested If statements" but I was wondering if there is a cleaner, more organized way.

Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>