SELECT TOP 1 equivalent on AS400

K

kh

I am developing an ASP.Net app which hits an AS400 table. I have the
following SQL statement in ASP but get a token error when I execute:

Select TOP 1 prodmo, prodyr FROM AS400Table WHERE prprty = '11'
AND wlprdc = 'Product'
ORDER BY prodyr DESC, prodmo DESC

What is the SELECT TOP sql equivalent for AS400?

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
R

Rob T

There's a lot of SQL commands that are limited when using the odbc
connection/client access. You may want to try and post this in the odbcnet
newgroup. I ran into a lot of these limitations on our interface too.
Checking through my code, I don't see any 'select top' commands....except
where we copied the tables to a SQL server first. ;-)
 
B

bruce barker

in db2 its:

Select prodmo, prodyr
FROM AS400Table
WHERE prprty = '11' AND wlprdc = 'Product'
ORDER BY prodyr DESC, prodmo DESC
Fetch First 1 Row Only


-- bruce (sqlwork.com)


| There's a lot of SQL commands that are limited when using the odbc
| connection/client access. You may want to try and post this in the
odbcnet
| newgroup. I ran into a lot of these limitations on our interface too.
| Checking through my code, I don't see any 'select top' commands....except
| where we copied the tables to a SQL server first. ;-)
|
| | >I am developing an ASP.Net app which hits an AS400 table. I have the
| > following SQL statement in ASP but get a token error when I execute:
| >
| > Select TOP 1 prodmo, prodyr FROM AS400Table WHERE prprty = '11'
| > AND wlprdc = 'Product'
| > ORDER BY prodyr DESC, prodmo DESC
| >
| > What is the SELECT TOP sql equivalent for AS400?
| >
| > *-----------------------*
| > Posted at:
| > www.GroupSrv.com
| > *-----------------------*
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top