Re: Distinct insert
From: Robert (Robert_at_discussions.microsoft.com)
Date: 08/26/04
- Next message: Hugo Kornelis: "Re: Distinct insert"
- Previous message: Simon Jelinek: "IIS Logs Max Per Hour"
- In reply to: Hugo Kornelis: "Re: Distinct insert"
- Next in thread: Hugo Kornelis: "Re: Distinct insert"
- Reply: Hugo Kornelis: "Re: Distinct insert"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 08:39:12 -0700
I can't post the structure or data because it's against our policies. I can
provide you something that looks similair. I basically need to be able to
insert only the unique account numbers from one table into another table,
however at the same time inserting a unique primary key into the same
destination table.
For example I kinda have something like this:
Primary Key From Table 1, Account Number
1,A
2,A
3,B
4,C
5,B
I need to put that information in a seperate table that is similair to this:
Primary From table2, Account Number
-564564,K
564578,D
7246,S
54567,F
The second table can not have any duplicate account numbers and of course
the Primary key.
What I want to do is select from table1 something looking like this:
Primary Key From Table 1, Account Number
1,A
3,B
4,C
Leaving me only with unique primary keys and account numbers.
The end result for table2 should look something like this:
-564564,K
564578,D
7246,S
54567,F
1,A
3,B
4,C
"Hugo Kornelis" wrote:
> On Thu, 26 Aug 2004 05:55:04 -0700, Robert wrote:
>
> >Unfortunately I do not have the create table SQL statements
> (snip)
>
> Hi Robert,
>
> Did you read the links I posted in my message? They contain instructions
> on how you can generate the create table statements from the existing
> tables (the ewb site shows how it's done with Query Analyzer; there's an
> option to generate SQL in Enterprise Manager as well).
>
> I read your description, but I can't figure out what you're trying to do
> and what problems you are trying to tackle. I really need the table
> structure and sample data to understand your problem.
>
> (BTW, if therre are legal or other issues that prohibit you from posting
> the table structure, you may also create a fake table that recreates the
> problem).
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>
- Next message: Hugo Kornelis: "Re: Distinct insert"
- Previous message: Simon Jelinek: "IIS Logs Max Per Hour"
- In reply to: Hugo Kornelis: "Re: Distinct insert"
- Next in thread: Hugo Kornelis: "Re: Distinct insert"
- Reply: Hugo Kornelis: "Re: Distinct insert"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|