pattern matching - How to display this: row pair - column a value of one row is in column b of row 2 and column a value of second row is in column b of first row oracle? -


i have table of bus details. has bus_name, bus_source , bus_destination. need know bus pairs make return journey possible. eg.

  bus_name | bus_source | bus_destination            | chennai    | bangalore     b      | bangalore  | chennai     c      | mumbai     | chennai   

i expect this:

  bus_name | bus_source | bus_destination          | chennai    | bangalore     b      | bangalore  | chennai 

use exists() :

select * yourtable t exists(select 1 yourtable s              t.bus_source = s.bus_destination                , t.bus_destination = s.bus_source); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -