sql - select columns with value NA -


how select columns in table contain specific value rows? trying find these columns update on values null value. in columns have varied range of values including na

i using sql server 2012.

i've tried doing: thsi gives me column names. can add condition columns value 'na'?

select  column_name names,column_default    information_schema.columns   table_schema = 'dbo'     , table_name = 'abc' 

i beginner in sql. trying figure out how this.

if min of column equals max column contains same values:

select      case when min(col1) = max(col1) 1 else 0 end col1issame,     case when min(col2) = max(col2) 1 else 0 end col2issame,     ... table 

with dynamic query:

declare @s nvarchar(max) = 'select '  select  @s = @s + 'case when min(' + column_name + ') = max(' +          column_name + ') 1 else 0 end ' + column_name + ','    information_schema.columns   table_schema = 'dbo'     , table_name = 'table'  set @s = substring(@s, 1, len(@s)  - 1) + ' table'  exec(@s) 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -