SQL Query to be grouped based on Column values [message #672515] |
Wed, 17 October 2018 03:58  |
sober_sandy
Messages: 1 Registered: September 2008
|
Junior Member |
|
|
Hello,
How can I query a table to fetch records for each process_id. If there is 'Match' & 'No Match' then output should have
'Match'. If all are 'No Match' output should be 'No Match'
create table t1 (p_id number, result varchar2(100));
Insert into T1 (p_id,result) values ('74','Match');
Insert into T1 (p_id,result) values ('107','No Match');
Insert into T1 (p_id,result) values ('107','No Match');
Insert into T1 (p_id,result) values ('107','Match');
Insert into T1 (p_id,result) values ('110','No Match');
Insert into T1 (p_id,result) values ('110','No Match');
Insert into T1 (p_id,result) values ('110','No Match');
Insert into T1 (p_id,result) values ('115','Match');
Insert into T1 (p_id,result) values ('115','Match');
Output
=======
74 Match
107 Match
110 No Match
115 Match
Thanks !!
Sandy
|
|
|
|