November 5, 2014 at 2:44 am
Hi all,
please help me in get the desired output:
DDL are here:
Create table table1
(
ID int,
name varchar(10)
)
Create table table2
(
ID int,
table1_Id int,
status char(1)
)
Insert into table1
values (1,'A'), (2,'B'),(3,'C')
INSERT INTO table2
VALUES (1,1,'A'), (2,1,'I'), (3, 2,'A')
Output:
Name table1_Id Status
C 2 'A'
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
November 5, 2014 at 2:54 am
SELECT * FROM Table2 WHERE Status = 'A';
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 5, 2014 at 3:04 am
sorry, posted the wrong desired output..
please seet he modified one
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
November 5, 2014 at 3:22 am
kapil_kk (11/5/2014)
sorry, posted the wrong desired output..please seet he modified one
You should also provide an explanation of what you are trying to accomplish.
At the top of my head, I can imagine 3 different WHERE clauses that will give the same output for the sample data.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply