SELECT
DISPLAY_ID,
PICKER_NAME,
CREDIT,
HOURLY_RATE,
DAILY_RATE,
WEIGHT,
CASE
WHEN (DeviceGroups IS NOT NULL AND WorkerGroups IS NOT NULL) THEN CONCAT(DeviceGroups,',',WorkerGroups);
WHEN (DeviceGroups IS NULL AND WorkerGroups IS NOT NULL) THEN WorkerGroups;
WHEN (DeviceGroups IS NOT NULL AND WorkerGroups IS NULL) THEN DeviceGroups;
WHEN (DeviceGroups IS NULL AND WorkerGroups NOT NULL) THEN NULL;
END as GROUPS
FROM....
我尝试使用Case When语法和alians一样,我收到了这个错误:
SQL查询:文档
SELECT DISPLAY_ID,PICKER_NAME,CREDIT,HOURLY_RATE,DAILY_RATE,WEIGHT, 案件 什么时候(
DeviceGroups不是NULL AND WorkerGroups不是NULL ) 那么CONCAT(DeviceGroups,',',WorkerGroups);
MySQL说:文档
答案 0 :(得分:2)
删除分号:
Traceback (most recent call last):
File "C:/Users/UT/PycharmProjects/tkinter/python_PET/main.py", line 16, in <module>
m = menu_bar_class(root)
File "C:/Users/UT/PycharmProjects/tkinter/python_PET/main.py", line 14, in __init__
self.master.config(self.menu)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1326, in configure
return self._configure('configure', cnf, kw)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1312, in _configure
cnf = _cnfmerge(cnf)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 114, in _cnfmerge
for c in _flatten(cnfs):
AttributeError: Menu instance has no attribute '__len__'
在标准SQL中,分号(;)用于结束查询。