运行出现的错误:
MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => SELECT top 10 g.goods_id, g.goods_name, g.et_price, g.shop_price AS org_price,ISNULL(mp.user_price, g.shop_price * '1') AS shop_price, g.promote_price, g.promote_start, g.promote_end, g.goods_thumb, g.goods_img, g.goods_brief FROM `shop`.`ecs_goods` AS g LEFT JOIN `shop`.`ecs_member_price` AS mp ON mp.goods_id = g.goods_id AND mp.user_rank = '0' WHERE g.is_delete = 0 AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND (( 1 ) ) AND (g.goods_id not in (select top 0 g.goods_id from `shop`.`ecs_goods` AS g LEFT JOIN `shop`.`ecs_member_price` AS mp ON mp.goods_id = g.goods_id AND mp.user_rank = '0' ORDER BY goods_id DESC) ) [2] => Array ( [error] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10 g.goods_id, g.goods_name, g.et_price, g.shop_price AS org_price,ISNULL(mp' at line 1 ) [3] => Array ( [errno] => 1064 ) ) 
因该如何改正呢,谢谢!

解决方案 »

  1.   

     [error]   =>   You   have   an   error   in   your   SQL   syntax;   check   the   manual   that   corresponds   to   your   MySQL   server   version   for   the   right   syntax   to   use   near   '10   g.goods_id,   g.goods_name,   g.et_price,   g.shop_price   AS   org_price,ISNULL(mp'   at   line   1   ) 
    ================================================================
    mysql 用limit
      

  2.   

     top   10   错误
      

  3.   

    mysql 不支持 top 语法,换用limit 0 ,10
      

  4.   

    我知道不支持,可是我现在要把mysql改成用sql server
      

  5.   

    select .....  where ...... ORDER   BY   goods_id   DESC Limit 0,10;
      

  6.   

    我要用select top语句,要用mssql来实现,谢谢
      

  7.   

    你现在用的数据库明显是mysql,当然只能写mysql支持的语句才能用来查询数据库了,所以应该改成
    select .....  where ...... ORDER  BY  goods_id  DESC Limit 0,10;
    这种写法。