Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Req: SQL query help

Status
Not open for further replies.

DukeArgos

Technical User
Feb 26, 2002
9
US
table fields=
prefix,name,type,suffix,lowaddr,highaddr,grid#

example records=
N,John Doe,St,,1,200,34
N,John Doe,St,,201,203,35
N,John Doe,St,,204,600,24
S,John Doe,St,,1,3,55

I would like the results of a query to be=
N,John Doe,St,,1,200,34
N,John Doe,St,,204,600,24
S,John Doe,St,,1,3,55

I'd like to omit any "multiple" records that have the same prefix,name,type,suffix information and a difference between lowaddr and highaddr less than 5. But the output needs to include all the fields including the lowaddr,highaddr, and grid#. The output also needs to include "single" records that have a difference between the addresses of less than 5.

Does anyone have any ideas or suggestions how to do this?
TIA!!!
 
DukeArgos

You would most likely have to do it in two SQLs. One to pick the "less then 5" and from there determine the distinct one and a second SQL to exclude the less then 5 and at the end combine the both. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

Thanks for your response and trying to help me!!!

your suggestion worked just fine and i was able to achieve the desired result.

thanks for the help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top