Home > database > For help! Questions about oracle database code to mysql code..
For help! Questions about oracle database code to mysql code..
Time:10-15
Select
The from ( Selectvehicle vehicleid, vehicle Platenumber, Total COUNT (devicerunning. Deviceid), The sum (decode (Warningtypeid, 1,1,2,1,3,1,0) TypeA, The sum (decode (Warningtypeid, 4,1,5,1,6,1,7,1,8,1,9,1,10,1,0)) TypeB, The sum (decode (Warningtypeid, 11,1,12,1,13,1,0)) TypeC, The sum (decode (Warningtypeid, 1, 0)) as Type1, The sum (decode (Warningtypeid, 2, 0)) as Type2, The sum (decode (Warningtypeid, 3, 0)) as Type3, The sum (decode (Warningtypeid, 4, 0)) as Type4, The sum (decode (Warningtypeid, 5, 0)) as Type5, The sum (decode (Warningtypeid, 6, 0)) as Type6, The sum (decode (Warningtypeid, 7, 0)) as Type7, The sum (decode (Warningtypeid, 8, 0)) as Type8, The sum (decode (Warningtypeid, 9, 0)) as Type9, The sum (decode (Warningtypeid, 10, 0)) as Type10, The sum (decode (Warningtypeid, 11, 0)) as Type11, The sum (decode (Warningtypeid, 12, 0)) as Type12, The sum (decode (Warningtypeid, 13, 0)) as Type13 Decode function in the code above the sum function in mysql, so try to sum (case when Warningtypeid=1 then 1 · · · · · · the when Warningtypeid=3 then 1 else 0 end) TypeA, report format error, excuse me how should change