You are here: ORDER BY AND GROUP BY CLAUSE « MsSQL Server « IT news, forums, messages
ORDER BY AND GROUP BY CLAUSE

Posted by bwalton_707 on 11/27/07 17:40

I'm completely lost why a trival task in VFP is a lengthy drawn out
process in SQL Server

For Example

A simple select statement where I want to return the most current date
from a table along with the unique identifier for the row selected is
a single select statement in VFP

SELECT TOP 1 date, id
FROM anytable
ORDER BY id, date desc
GROUP BY id

OR Another example

SELECT invoice.number, customer.name, customer.address, invoice.id,
customer.id
FROM invoice
INNER JOIN customer
ON invoice.customerid = customer.id
ORDER BY customer.id, invoice.date DESC
GROUP BY customer.id

This will return the most recent order for a customer

Niether selects statements are supported in SQL Server 2005... Is
there a logical reason WHY? Other then ansi standards which I'm not
buying as m$ft rarely follows any standards but there own 100% of the
time anyway.

Also could someone please post the most efficent SQL eq

 

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

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