MySQL Forums
Forum List  »  Views

Create View joining same column and table
Posted by: Neil J
Date: August 24, 2010 01:10AM

I can't get my head around the sql which I also has to work for SQL server as well as MySQL.

Basically I need to create a view on a single table where I compare the value in a column against other values of the smae column.

For example

Tab A

col 1 col2

row 1 123456 345
row 2 111111 111
row 3 22 345 888 345

Basically I want something like select col1 from Tab A where col2 like col1

in the above I'd want row 1 and 3 to be returned in the view.


Options: ReplyQuote

Written By
Create View joining same column and table
August 24, 2010 01:10AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.