如果可能的话,我想问一下这个查询。
我有一个表,其中包含如下所示的列:
class_01|class_02|class_03|class_04|class_05|class_06|class_07|class_08|class_09|
Sonto   | Botak  | Semut  | Setting|'<none>'|'<none>'|'<none>'|'<none>'|'<none>'|
然后我写一个这样的where子句:
SELECT bedrnr 
FROM   bedryf 
WHERE  class_01 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_02 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_03 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_04 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_05 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_06 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_07 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_08 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
    OR class_09 IN ('Sonto', 'Botak',  'Semut', 'Setting') 
这是一个 where 子句,其中 IN 的值在那里相同,但它只想在 9 个不同的列中找到。有什么办法可以让查询更短吗?