How to do SQL select top N … in AS400

前端 未结 6 770
执笔经年
执笔经年 2020-12-28 13:40

How do you perform a

Select top N * from as400table

type query against an as400/db2 database

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 14:06

    Wouldn't it be easier to limit the result instead? Bellow is in order by date and I take the top result

    SELECT banana_equipment_id 
    FROM new_banana_equipment 
    WHERE banana_code=0000001
    ORDER BY banana_date DESC 
    LIMIT 1;
    

提交回复
热议问题