| Author |
getting reciprocal values from a table
|
Taffy Smith
Greenhorn
Joined: Jun 29, 2009
Posts: 1
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26144
|
|
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?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: getting reciprocal values from a table
|
|
|