特定の列にすべて「準拠」という単語が含まれているかどうかを確認したいテーブルがあります
列はすべてvarcharです。
このクエリはCompliant
、いずれかの列にある行を選択します。
SELECT curb_reveal_check,
ramp_running_slope_counter_slope_check,
curb_defective_check,
sidewalk_defective_check,
ponding_check,
crosswalk_location_check,
gutter_slope_check,
flare_slope_check,
ramp_cross_slope_check,
ramp_width_check,
obstacles_check,
dws_check,
ramp_running_slope_check,
apex_turning_space_check,
cut_through_check,
landing_length_check,
landing_width_check,
landing_slope_check,
landing_check FROM table
where 'Compliant' in(ramp_running_slope_counter_slope_check,
curb_defective_check,
sidewalk_defective_check,
ponding_check,
crosswalk_location_check,
gutter_slope_check,
flare_slope_check,
ramp_cross_slope_check,
ramp_width_check,
obstacles_check,
dws_check,
ramp_running_slope_check,
apex_turning_space_check,
cut_through_check,
landing_length_check,
landing_width_check,
landing_slope_check,
landing_check)
しかし、私はそれらすべてを含む必要があります Compliant
すべてをinに置き換えてみましたが、このエラーが発生しました
Msg 156, Level 15, State 1, Line 20
Incorrect syntax near the keyword 'all'.
ここで明示する必要があります。
WHERE ramp_running_slope_counter_slope_check = 'Compliant'
AND curb_defective_check = 'Compliant'
AND sidewalk_defective_check = 'Compliant'
AND ponding_check = 'Compliant'
etc...
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加