Reply to Re: Problem with SELECT

Your name:

Reply:


Posted by Ted on 08/21/06 19:37

boa wrote:
> * Ted wrote, On 21.08.2006 17:28:
> > I constructed the following SQL statement by studying the example on
> > page 392 in Itzik Ben Gan et al.'s "Inside Microsoft SQL Server 2005:
> > T-SQL Querying"
> >
> > SELECT s_supplier_code, s_supplier_name FROM suppliers AS S1
> > WHERE s_supplier_code =
> > (
> > SELECT TOP(1) * FROM suppliers AS S2
> > WHERE S2.s_supplier_code = S1.s_supplier_code
> > ORDER BY s_supplier_name
> > )
> > ;
> >
> > However, it generates the following error.
> >
> > Msg 116, Level 16, State 1, Line 4
> > Only one expression can be specified in the select list when the
> > subquery is not introduced with EXISTS.
>
>
> What happens if you replace
> select top(1) *
> with this?
> select top(1) some_column_name
>
Nothing changes. The same error is generated.

Thanks

Ted

[Back to original 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

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