This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help on having clause

 
Ram Korutla
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My objective is to identify records in a table where there is more than record with the same <col1,col2> combination.
Using the having clause, I can only check for one column right, how to get similar feature if I want to check on a combination
Please help

Thanks
Sridhar
 
Hemavathy Ramamoorthy Gopal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sridhar,

Please try out.

select * from table A where A.col1 = 'data' and A.col1=A.col2

or

select * from table A, table A1 where A.col1=A1.col2

Please reply with your feedback whether you meet your requirement or not.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like that ?
 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use self-join.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic