I need some help. I want to show database that has name "sample"
but except "sample"
with "fallback"
word.
Database Name
sample_1
2_sample
sample_fallback
samsple_2
s_sample
fallback_sample
I just want to get:
sample_1
2_sample
samsple_2
s_sample
What should I add from this query?
"SHOW DATABASES LIKE '%sample%';"
You're going to need to query the information_schema
directly to get this list.
select schema_name
from information_schema.schemata
where schema_name like '%sample%'
and schema_name not like '%fallback%'
SHOW DATABASES
isn't flexible enough.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加