Oracle,Sql Server, MySql, DB2使用sql分页(ZZ)的DB2:
select * from (select *,rownumber() as ROW_NEXT from tablename) where ROW_NEXT between min and max
用php的db2_exec執行會產生這樣的錯誤:
42601:[IBM][CLI Driver][DB2/6000] SQL0104N An unexpected token “*” was found following “lect * from (select”. Expected tokens may include: “?”. SQLSTATE=42601 SQLCODE=-104
後來我看了很多篇文章,發現都是有指定欄位名稱居多,用*就不能表示,後來靈機一動,用tablename.*,yes 可以動!
想不出來為何不行?不過我這樣可以完成我的目的就不再追就了!
2008-08-05