Skip to content
Advertisement

Tag: mysql

SQL to check if database is empty (no tables)

I need to check if a database is totally empty (no tables) using an SQL query. How can this be done? Thanks for the help! Answer will return the actual number of tables (or views) in your DB. If that number is 0, then there are no tables.

MySQL query to extract first word from a field

I would like to run a query that returns the first word only from a particular field, this field has multiple words separated by spaces, I assume I may need to carry out some regex work to accomplish this? I know how to do this using a few ways in PHP but this would best be carried out on the

Advertisement