diff --git "a/\344\270\200\346\256\265\345\244\232\350\241\250\350\201\224\346\237\245\347\232\204\347\232\204SQL,\345\214\205\345\220\253\350\256\241\346\225\260\357\274\214\345\214\205\345\220\253\345\210\206\347\273\204\357\274\214\345\214\205\345\220\253\346\216\222\345\272\217\357\274\214\345\214\205\345\220\253\347\273\237\350\256\241" "b/\344\270\200\346\256\265\345\244\232\350\241\250\350\201\224\346\237\245\347\232\204\347\232\204SQL,\345\214\205\345\220\253\350\256\241\346\225\260\357\274\214\345\214\205\345\220\253\345\210\206\347\273\204\357\274\214\345\214\205\345\220\253\346\216\222\345\272\217\357\274\214\345\214\205\345\220\253\347\273\237\350\256\241" new file mode 100644 index 0000000000000000000000000000000000000000..bcee8bdb37cadc229469844db17a4b02ed551581 --- /dev/null +++ "b/\344\270\200\346\256\265\345\244\232\350\241\250\350\201\224\346\237\245\347\232\204\347\232\204SQL,\345\214\205\345\220\253\350\256\241\346\225\260\357\274\214\345\214\205\345\220\253\345\210\206\347\273\204\357\274\214\345\214\205\345\220\253\346\216\222\345\272\217\357\274\214\345\214\205\345\220\253\347\273\237\350\256\241" @@ -0,0 +1,36 @@ +// +一句sql包含相关信息的所有查询,字段计数,多表联查,条件,分组,排序,分页 +SELECT +sum(c.fz+c.pf+c.gf+c.yf) as zf, +sum(c.fz) as fz,sum(c.pf) as pf, +sum(c.gf) as gf,sum(c.yf) as yf, +sum(c.zwh) as zwh, +a.jz, +a.pwlll, +a.dz, +a.lll, +a.mtype, +a.id, +a.userid, +a.type, +a.title, +a.member, +b.name, +b.phone, +b.mail, +b.sf, +b.city, +b.school, + +FROM `shuaijin_dcj_production` `a` +LEFT JOIN `shuaijin_dcj_user` `b` +ON `a`.`userid`=`b`.`userid` + +LEFT JOIN `shuaijin_dcj_pf` `c` +ON `a`.`id`=`c`.`conid` + +WHERE `a`.`status` = 2 AND `a`.`jz` IN ('0','1','2','3','4') +GROUP BY `a`.`id` +ORDER BY `zf` DESC,`a`.`tp` ASC,`a`.`dz` DESC,`a`.`lll` DESC,`a`.`id` DESC + +LIMIT 0,120 \ No newline at end of file