You are here: Re: need help to take the variables associated with the 1st occurrence of a date variable « MsSQL Server « IT news, forums, messages
Re: need help to take the variables associated with the 1st occurrence of a date variable

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация