我想在MySQL中实现三元条件运算符.我有一个表,其中存在一个字段ID.其值可能为null.我想以id三元条件格式显示如下:
select id = id == null ? 0 : id;
Run Code Online (Sandbox Code Playgroud)
在MySQL中有可能吗?
我试图用枚举绑定一个列表.枚举有以下价值
public enum Degree
{
Doctorate = 1,
Masters = 2,
Bachelors = 3,
Diploma = 4,
HighSchool = 5,
Others = 6
}
Run Code Online (Sandbox Code Playgroud)
并且列表是以下类的类型
class List1
{
public string Text{get; set;}
public string Value{get; set;}
}
Run Code Online (Sandbox Code Playgroud)
如何映射呢?