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

condition Query check

$
0
0

Create table #temp
(
Row_num bigint identity(1,1),
Group_namenvarchar(20),
default_flag bit,
default_value nvarchar(20)
)


insert into #temp (Group_name,default_flag,default_value)
values ('First',1,'Default'),
('First',1,'A'),
('First',1,'B'),
('Second',0,'Default'),
('Second',0,'A'),
('Second',0,'B'),
('Third',1,'Default'),
('Third',1,'A'),
('Third',1,'B'),
('Fourth',0,'Default'),
('Fourth',0,'A'),
('Fourth',0,'B')

select * from #temp 

Output should be below

drop table #temp


vishnu dalwadi


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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