Shrander
2012-11-26 01:07:19 UTC
List the contents of multiple rows if and only if the value in column x is found in any other row in the same column.
It cannot output the row if there aren't more rows where the value in column x matches.
I figure it would be easier with subqueries or something. Easiest way I can think of would be doing something like:
SELECT * FROM table_name WHERE 1 > (SELECT count(*) from table_name where subquery.column_x = parent_query.columnx)
So, similar to a nested loop.
But, I have no clue how to have a subquery reference the parent query.
A solution for the main problem, whether it is similar to my idea or not would be appreciated.