rajprakashraj Posted December 20, 2017 Report Posted December 20, 2017 table A col1 col2 col3 1 PR test 1 JNT test1 2 PR test3 3 PR test4 3 JNT test5 i should get only records which have both PR,JNT for col1 Quote
Bhai Posted December 20, 2017 Report Posted December 20, 2017 16 minutes ago, rajprakashraj said: table A col1 col2 col3 1 PR test 1 JNT test1 2 PR test3 3 PR test4 3 JNT test5 i should get only records which have both PR,JNT for col1 idhi try cheyyi... syntax errors emanna ravochemo select col1,count(distinct col2) as qual from table where col2 in ('PR','JNT') group by col1 having count(distinct col2) >1 Quote
khabardar Posted December 20, 2017 Report Posted December 20, 2017 select a.* from tableA A join table A B on a.col1 = b.col1 where a.col2 = 'PR ' and b.col2 = 'JNT' -- this sql server ki .. mostly same untadi oracle ki.. Quote
Bhai Posted December 20, 2017 Report Posted December 20, 2017 16 minutes ago, rajprakashraj said: table A col1 col2 col3 1 PR test 1 JNT test1 2 PR test3 3 PR test4 3 JNT test5 i should get only records which have both PR,JNT for col1 Just now, Bhai said: idhi try cheyyi... syntax errors emanna ravochemo select col1,count(distinct col2) as qual from table where col2 in ('PR','JNT') group by col1 having count(distinct col2) >1 oracle lo eppudu cheyyaledu.. hope it will work w/o syntax issues Quote
Idassamed Posted December 20, 2017 Report Posted December 20, 2017 34 minutes ago, Bhai said: oracle lo eppudu cheyyaledu.. hope it will work w/o syntax issues Quote
rajprakashraj Posted December 20, 2017 Author Report Posted December 20, 2017 1 hour ago, Bhai said: idhi try cheyyi... syntax errors emanna ravochemo select col1,count(distinct col2) as qual from table where col2 in ('PR','JNT') group by col1 having count(distinct col2) >1 thanks dude..worked Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.