Home > database >  Mysql for help
Mysql for help

Time:09-17

If I watch the two fields select t.T ypeName, t.L ayer from sw_devicetype t
I need to realize is that when the Layer=1 take alias TypeName1 TypeName, Layer TypeName take alias TypeName2=2, Layer TypeName take alias TypeName3=3, only 1, 2, 3, then can achieve? Don't trigger a class

CodePudding user response:

What you need, here are included, with less than that in which, when it does not exist,
The select t.T ypeName, t.L ayer,
DECODE (Layer 1, TypeName) TypeName1,
DECODE (Layer 2, TypeName) TypeName2,
DECODE (Layer 3, TypeName) TypeName3
The from sw_devicetype t

CodePudding user response:

reference 1st floor AHUA1001 response:
what you need, here are included, with less than that in which, when it does not exist,
The select t.T ypeName, t.L ayer,
DECODE (Layer 1, TypeName) TypeName1,
DECODE (Layer 2, TypeName) TypeName2,
DECODE (Layer 3, TypeName) TypeName3
The from sw_devicetype t



Counting error, the parameter is not correct what is meant by the Incorrect parameter count in the call to native function "DECODE"
  • Related