我有一个生成表的 sql 查询
SELECT DISTINCT
concat(table.column, '.test.com) "User Login",
concat(concat(table.columnname, ' '), lastname) "Full Name",
'N' "Admin (Y/N)",
table.profile "Profile",
'Self' "admin",
'Self' "user",
FROM table.users
我想在上面的查询中添加一个 case 语句。
If (table.profile == admin){
admin = self;
user = null;
}
else{
admin = null;
user = self;
}
任何人都可以帮忙吗?