0

I have a database with orign_ip, destination_ip, and other columns. I am looking for a way to get in SQL just the connections between two IP's, I need to get just the list. This is my first step :

SELECT DISTINCT orig_h , resp_h from gustavo.conn;
 - 15.214.135.70                15.214.159.100
 - 15.214.136.45                15.214.137.70

But How I can get from this result the just the rows that match with

15.214.135.70               15.214.159.100 
grojas123
  • 1
  • 2
  • If there was a row with orig_h = 15.214.159.100 and resp_h = 15.214.135.70 would you want to see that as well? –  Aug 21 '19 at 11:44

1 Answers1

0

SELECT DISTINCT orig_h , resp_h from gustavo.conn WHERE orig_h = '15.214.135.70' AND resp_h = '15.214.159.100'

  • Thank you . But in case Do I need to store the result of the first query in a temp table and do this thing for all the pairs ? One by one . – grojas123 Aug 21 '19 at 00:01
  • I am looking some way to collect all the connections in one query . I am looking to create some temporary table . What you think ? – grojas123 Aug 21 '19 at 00:03
  • @grojas123: given your sample data, this is the best answer you can get. –  Aug 21 '19 at 11:43