This is a read-only copy of the MariaDB Knowledgebase generated on 2024-05-20. For the latest, interactive version please visit https://mariadb.com/kb/.

USE

Sintassi

USE nome_db

Spiegazione

L'istruzione 'USE nome_db' dice a MariaDB di utilizzare il database db_name come database predefinito (corrente) per le istruzioni successive. Il database rimane predefinito fino alla fine della sessione o fino a quando viene eseguita un'altra istruzione USE:

USE db1;
SELECT COUNT(*) FROM mia_tabella;   # seleziona da db1.mytable
USE db2;
SELECT COUNT(*) FROM mia_tabella;   # seleziona da db2.mytable
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.