Link to home
Start Free TrialLog in
Avatar of andyw27
andyw27

asked on

Creating mirror results in SELECT statement

Hi,

I have simple select query that returns results similar to this:

rel_type_id      left_name      right_name
35      Parent      Child
36      Referenced By      Reference To
37      Propagated From      Propagated To

I need to add something clever to the SQL that will automatically create the mirror of these thus returning 6 results, ideally with a new column with zero denoting original and 1 denoting the mirror

rel_type_id      left_name      right_name      Type
35      Parent      Child      0
36      Referenced By      Reference To      0
37      Propagated From      Propagated To      0
35      Child      Parent      1
36      Reference To      Referenced By      1
37      Propagated To      Propagated From      1

Any suggestions greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Surendra Nath
Surendra Nath
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andyw27
andyw27

ASKER

cool, simple when you know how.  Thanks for the quick reply.