I have a table yrs_order which has columns like:
header_key (primary key)
order_no
ref1
ref2
ref3
I want to get a list of all the rows for which ref1 is identical.
How can i do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you just want a specific
ref1, you can use:However, I suspect you’re after all rows that share a
ref1value. If that’s the case, the first step is to get a list of allref1values where there are more than one:Then you can use that as a subquery to get a list of all the rows:
The following transcript shows this in action:
That shows the creation and population of the table, now for the query requested:
You can see there that the two rows with a count of one have been excluded.