Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: as400 LIMIT syntax


Message #1 by "Ben Dean" <ben.dean@t...> on Wed, 20 Jun 2001 13:48:28
SELECT TOP 10 table1.foo, COUNT(table1.foo) AS foocount
FROM table1, table2
WHERE table1.foo = table2.foo
GROUP BY foo

-----Original Message-----
From: Ben Dean [mailto:ben.dean@t...]
Sent: Wednesday, 20 June 2001 11:48 PM
To: sql language
Subject: [sql_language] as400 LIMIT syntax


hey i want to do a query where i limit the number of records returned. 
normal i'd do this like this:

SELECT table1.foo, COUNT(table1.foo) AS foocount
FROM table1, table2
WHERE table1.foo = table2.foo
GROUP BY foo
LIMIT 10

however in the as400, it complains about that LIMIT statement. says that 
its not a valid statement. what does the FOR command do in SQL for the 
as400? is it anything like LIMIT. also, is there any place at all that i 
can but LIMIT in this statement. i don't see why LIMIT isn't valid syntax 
and on the 400. it works fine for a lot of other things, like mySQL and ms 
access.


  Return to Index