求教假猪冲突搭配问题 希望大神解答一下 多谢
展开全部
<pre t="code" l="sql">SELECTdatecardtimeastimecarddate,
count(caseresultwhen#39;胜#39;thenresultend)asvictory,
count(caseresultwhen#39;负#39;thenresultend)asfailed
FROMmatchresultGROUPBYdatecardtime这是第一题的sql语句<pre t="code" l="sql">dept.unitid,
dept.unitname,
count(emp.empid)ASempheadcount
FROM
dept
leftJOINempONdept.unitid=emp.unitid
GROUPBYdept.unitid这是第二题的sql语句<pre t="code" l="sql">SELECT`name`,
CASEcalendardataWHEN#39;2005-05-0100:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050501#39;,
CASEcalendardataWHEN#39;2005-05-0200:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050502#39;,
CASEcalendardataWHEN#39;2005-05-0300:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050503#39;,
CASEcalendardataWHEN#39;2005-05-0400:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050504#39;,
CASEcalendardataWHEN#39;2005-05-0500:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050505#39;FROMempcalendar
GROUPBY`name`这是第三题的sql语句
count(caseresultwhen#39;胜#39;thenresultend)asvictory,
count(caseresultwhen#39;负#39;thenresultend)asfailed
FROMmatchresultGROUPBYdatecardtime这是第一题的sql语句<pre t="code" l="sql">dept.unitid,
dept.unitname,
count(emp.empid)ASempheadcount
FROM
dept
leftJOINempONdept.unitid=emp.unitid
GROUPBYdept.unitid这是第二题的sql语句<pre t="code" l="sql">SELECT`name`,
CASEcalendardataWHEN#39;2005-05-0100:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050501#39;,
CASEcalendardataWHEN#39;2005-05-0200:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050502#39;,
CASEcalendardataWHEN#39;2005-05-0300:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050503#39;,
CASEcalendardataWHEN#39;2005-05-0400:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050504#39;,
CASEcalendardataWHEN#39;2005-05-0500:00:00#39;THENclassnameELSE#39;#39;ENDAS#39;D20050505#39;FROMempcalendar
GROUPBY`name`这是第三题的sql语句
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询