First function in SQL Server

Jigs

Registered User.
Local time
Today, 08:54
Joined
May 19, 2005
Messages
40
Hi All,

I m using MS-access as backend and I am using the following query where I use FIRST() as aggregrate function.

SELECT FIRST(COUNTRY) AS FIRSTOFCOUNTRY, ZONECODE FROM LOCATIONS GROUP BY COUNTRY,ZONECODE
HAVING ZONECODE = "ZONE01"

Now I have to shift my access database to SQL server 2000 where First() function does not work. I had searched for that but still cant find the alternative.

Can any one help me in solving this problem? :(

Thanks in advance,

Regards,

Jigs
 
Use the MIN function.

RV
 
The query doesn't make any sense. You are aggregating country - First(Country) and you are grouping by Country which says to return each individual value. These are a contradiction.
 
What are you trying to do since your query is not real clear as Pat pointed out.
 

Users who are viewing this thread

Back
Top Bottom