これは私の場合(SQL内)です。エラーが表示されます。 -ケース内で "and"と "in"を処理する方法
'I'付近の構文が正しくありません。
どうすれば対応できますか?
,case
when UserType like 'Teacher/Instructor and Type like 'I have a student currently in a School' then 'Ok'
else 'General'
これは私の場合(SQL内)です。エラーが表示されます。 -ケース内で "and"と "in"を処理する方法
'I'付近の構文が正しくありません。
どうすれば対応できますか?
,case
when UserType like 'Teacher/Instructor and Type like 'I have a student currently in a School' then 'Ok'
else 'General'
あなたは引用符とキーワードEND
不足している:それとは別に
case when UserType like 'Teacher/Instructor'
and Type like 'I have a student currently in a School'
then 'Ok'
else 'General'
end
を:LIKE
は、col LIKE 'Ab%'
として、ワイルドカード比較ですためのものです。 col LIKE 'Ab'
のようなワイルドカードを使用しない場合は、col = 'Ab'
の代わりに=
という単純なものを使用してください。等価性だけを探しているときにパターンマッチングを行わなければならないとDBMSに伝えないでください。
いくつかの問題がここにあります
else
句後end
キーワードが含まれていない「インストラクター」
case
when UserType like 'Teacher/Instructor' and
-- Issue #1 here ---------------------^
Type like 'I have a student currently in a School' then 'Ok'
else 'General'
end -- Issue #2 here