select GD2.*, GDS.SALE_TYPE, GDS.SALE_CNT, GPRICE AS PRICE_P, GPRICE AS PRICE_R, GDS.DISCOUNT, GDS.POINT, GDS.TRANS_TYPE, GDS.TRANS, GDS.VIEW, GDS.PRICE_ASK from (select GD.GDNO, GD.GCODE, GD.GNAME, GD.GPRICE, GD.MAKER, GD.BRAND, GD.ORIGIN, GD.INFO, GD.SPEC, GD.KEYWORD, GD.TOTAL_PURCH, GD.TOTAL_SALE, GD.PICS_NAME, GD.PICS_WIDTH, GD.PICM_NAME, GD.PICM_WIDTH, GD.PICL_NAME, GD.PICL_WIDTH, date_format(GD.RDTIME,'%Y%m%d') as RDATE, unix_timestamp(GD.RDTIME) as RDTIME_TS, GD.RDTIME from tops_goods GD, tops_goods_cate GDC where GD.GDNO=GDC.GDNOlimit 0,20) GD2, tops_goods_sale GDS where GD2.GDNO=GDS.GDNO order by GD2.GDNO desc
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 '0,20) GD2, tops_goods_sale GDS where GD2.GDNO=GDS.GDNO order by GD2.' at line 11