|
Posted by Erland Sommarskog on 03/09/06 01:27
(menglin.cao@gmail.com) writes:
> I have the following SQL code but the it didn't work. It says the
> columns are ambiguously defined. Anyone can help me? Greatly appreciate
> it!
>
> PROC SQL;
> CONNECT TO ORACLE (USER="&user" PASS="&pass" PATH="@POWH17"
> BUFFSIZE=25000);
Oracle? This is an SQL Server newsgroup!
> CREATE TABLE actvy1_1st AS SELECT * FROM CONNECTION TO ORACLE
> (
> SELECT
> actvy1.ID,
> actvy1.var1,
> actvy1.var2,
> actvy1.date
>
> from
> A actvy1,
> (select a.ID,
> min(a.date) mindate
> from A a,
> B c
> where a.ID =c.ID
> group by ID
This line appears to be the culprit.
And I wonder, should you really have B in the derived table?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|