I want output as Printers,Printers,null (select at least first two fields)
with this very existing query and any kind of join
select a.acName,a.discription,s.quentity from #Accounts a
inner join #stock s on a.id = s.acId where addDate between '2001-11-01' and '2001-11-11' and a.id = 1
What I have tried:
this is the scenario
create table #Accounts(id int, acName nvarchar(50), discription nvarchar(128))
insert into #Accounts values (1, 'Printers', 'Printers')
insert into #Accounts values (2, 'HD', 'HD')
insert into #Accounts values (3, 'Mouse', 'Mouse')
insert into #Accounts values (4, 'Monitor', 'Monitor')
create table #stock(id int, acId int, quentity int,addDate datetime )
insert into #stock values (1,1,20,'2001-01-01')
insert into #stock values (1,2,10,'2001-10-01')
insert into #stock values (1,3,11,'2001-12-01')
insert into #stock values (1,4,5,'2001-11-01')
select a.acName,a.discription,s.quentity from #Accounts a
inner join #stock s on a.id = s.acId where addDate between '2001-11-01' and '2001-11-11' and a.id = 1