From c044a307775ce57acb385d91c579c152a94fa2b5 Mon Sep 17 00:00:00 2001 From: shuaijin <780309705@qq.com> Date: Fri, 12 Jun 2020 11:08:53 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E4=B8=80=E6=AE=B5=E5=A4=9A=E8=A1=A8?= =?UTF-8?q?=E8=81=94=E6=9F=A5=E7=9A=84=E7=9A=84SQL,=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=EF=BC=8C=E5=8C=85=E5=90=AB=E5=88=86=E7=BB=84?= =?UTF-8?q?=EF=BC=8C=E5=8C=85=E5=90=AB=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E7=BB=9F=E8=AE=A1.=20=E4=B8=80=E5=8F=A5=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=E4=BD=86=E6=98=AF=E5=8A=9F=E8=83=BD=E5=BC=BA=E5=A4=A7?= =?UTF-8?q?=E7=9A=84sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\205\345\220\253\347\273\237\350\256\241" | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 "\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" 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 0000000..bcee8bd --- /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 -- Gitee