You are here: Re: sql statement « MsSQL Server « IT news, forums, messages
Re: sql statement

Posted by Dan Guzman on 10/04/06 11:50

When you have a GROUP BY clause, columns in the select list must be in the
GROUP BY or in an aggregate function.

It's unclear to me what you are trying to accomplish with this query since
you are grouping by DOCInt.IDDoc but requesting all columns. What results
are you expecting?

--
Hope this helps.

Dan Guzman
SQL Server MVP

<iulian.ilea@gmail.com> wrote in message
news:1159962215.763990.115140@b28g2000cwb.googlegroups.com...
> What is wrong int this SQL statement?
>
> select top 10 DOCInt.*, DOCDet.* , Cate.*, Arti.*, [Ar An].*
> from
> DOCInt INNER JOIN DOCDet ON DOCInt.CodDoc=DOCDet.CodDoc
> LEFT JOIN Cate ON DOCDet.IDCategory=Cate.[ID Category]
> LEFT JOIN Arti ON DOCDet.IDArti=Arti.[ID Arti]
> INNER JOIN [Ar An] ON DOCInt.IDAnag=[Ar An].[ID An]
> GROUP BY DOCInt.IDDoc
>

 

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

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