Files
konabot/konabot/plugins/idiomgame/sql/query_idiom.sql
2025-11-18 19:36:05 +08:00

7 lines
405 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 查询成语是否在 all_idioms 中,如果存在则返回 1否则再判断是否在 custom_words 或 all_words 中,存在则返回 0否则返回 -1
SELECT
CASE
WHEN EXISTS (SELECT 1 FROM all_idioms WHERE idiom = ?) THEN 1
WHEN EXISTS (SELECT 1 FROM custom_words WHERE word = ?) OR EXISTS (SELECT 1 FROM all_words WHERE word = ?) THEN 0
ELSE -1
END AS status;