c# - Check if multiple mysql tables exist -



c# - Check if multiple mysql tables exist -

i want check mysql, if 3 tables exist somehow not work more 1 table? how can check if 3 tables exist?

select count(*) information_schema.tables table_schema = 'userbook' , table_name = 'entry' , table_name = 'stats' , table_name = 'user';

i'm working mysql-connector , microsoft visual studio 2012.

right now, looking table has name entry name stats , name user - @ same time. count 0 on this!

you need utilize or operator this:

select count(*) information_schema.tables table_schema = 'userbook' , (table_name = 'entry' or table_name = 'stats' or table_name = 'user')

you can utilize in, little bit easier maintain:

select count(*) information_schema.tables table_schema = 'userbook' , table_name in ('entry','stats','user')

in both cases: if count 3, 3 tables exist.

c# mysql mysql-connector

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -