Distinct insert
From: Dan (anonymous_at_discussions.microsoft.com)
Date: 08/27/04
- Previous message: John Steen: "RE: Help Finding records with matching columns"
- In reply to: Robert: "Distinct insert"
- Next in thread: Robert: "RE: Distinct insert"
- Reply: Robert: "RE: Distinct insert"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 27 Aug 2004 11:56:45 -0700
Have you tried something like:
insert into Accounts (AccountsOID,Account)
select min( "Rec NO" ) + 100 as AccountsOID, "LIC
TAG" as Account from AutoExpt group by "LIC TAG"
grahamdnle@yahoo.com
>-----Original Message-----
>I am trying to insert a record id primary at the same
time that I am trying
>to insert a Distinct Account number.
>
>The insert statement is something kind of like this:
>
>insert into Accounts (AccountsOID,Account)
> select Distinct "Rec NO" + 100 as
AccountsOID, "LIC TAG" as Account from
>AutoExpt
>
>In the AutoExpt table there are multiple occurrences
of "LIC TAG" values all
>of which need to be put into the Accounts table, however
there must be only
>one entry for the Lic tag in the accounts table. The Rec
No +100 is just to
>create a unique primary key for the AccountsOID.
>
>Is there anyway I can get only the Distinct Lic Tag's,
but at the same time
>get a unique primary key for them.
>
>Thanks,
>
>.
>
- Previous message: John Steen: "RE: Help Finding records with matching columns"
- In reply to: Robert: "Distinct insert"
- Next in thread: Robert: "RE: Distinct insert"
- Reply: Robert: "RE: Distinct insert"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|