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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having problems coding a query to do an insert

Status
Not open for further replies.

Bigced21

Programmer
Feb 5, 2003
76
US
Ok, Blr_Temp_Contact was imported into twice, first insert was done w/ OWNER info
and the Second import was done with USER info. which contains a total of 64300 records.
Now what I'm trying to do is write a statement that will take the first existence of a record and all other recs w/ the same addy or bus_name must be reference to that first rec using the ref_id. Here's an example of the data I want to display:
ID IMPORT_ID Ref_ID Type addy or bus_name
---------------------------------------------------------
1 32151 1 OWNR KENTON CO FISCAL COURT KY
32151 32151 32151 USER ROAD DEPARTMENT 4000 GLENN
2 32152 2 OWNR COMMONWEALTH OF KY
32152 32152 32152 USER COMMONWEALTH OF KY
3 32153 3 OWNR BENHAM SCHOOL HOUSE INN
32153 32153 32153 USER
4 32154 4 OWNR LAUREL HEIGHTS HOME
32154 32154 32154 USER 12 W 12TH ST
5 32155 4 OWNR LAUREL

Please help kind of lost!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top