Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getting reciprocal values from a table  RSS feed

 
Taffy Smith
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Is there a way I can write an sql query to return reciprocal values from a single table?

for example, if I have the following rows:



can I write a sql query that will return the first, and last row, since they have a reciprocal relationship? Or would I need to use a stored procedure with a cursor to loop through them all?

Thanks,
Taf
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taf,
How about doing a join (cartesian join that matches all of them) and see which come to the same value when diving a/b?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!