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

total row count get from table two different child table to one master table

$
0
0

Create table #tmp_master
(
mst_id int
)
Create table #tmp_child_one
(
mst_id int,
fname nvarchar(10)
)
Create table #tmp_child_two
(
mst_id int,
name nvarchar(10)
)

insert into #tmp_master
select 1
union all
select 2
union all
select 3
union all
select 4
union all
select 5
go

insert into #tmp_child_one
select 1,'a'
union all
select 2,'a'
union all
select 3,'a'
union all
select 4,'a'
go

insert into #tmp_child_two
select 2,'b'
union all
select 3,'b'
union all
select 4,'b'
union all
select 5,'b'
go


drop table #tmp_master
drop table #tmp_child_one
drop table #tmp_child_two

get output as below

 


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>