The difference between "-" and "no hyphen" is that the latter keeps your existing environment (variables, etc); the former creates a new environment (with the settings of the actual user, not your own). 带横杠的会创建一个全新的环境,使用的是真实用户的设置. 不带横杠
mysql> create database d-d; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-d' at line 1 1064报错:该错误一般出现在表名或者字段名设计过程中出现了mysql关键字导致的.问题确定是数据库名字的
查询一个数据库中所有表字段属性的sql语句 1.获取所有用户名: SELECT name FROM Sysusers where status='2' and islogin='1' islogin='1'表示帐户 islogin='0'表示角色 status='2'表示用户帐户 status='0'表示糸统帐户 2.获取所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name 3.获取所有表名 SELECT Name F
1.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name 2.查询某个数据库中所有的表名: SELECT Name FROM SysObjects Where XType='U' ORDER BY Name 3.查询表结构信息: 1 SELECT (case when a.colorder=1 then d.name else null end) 表名, 2 a.colorder 字段序号,a.name 字段名, 3
列出表名 直接 \d 不加参数 或 SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg%' AND tablename NOT LIKE 'sql_%' ORDER BY tablename; 列出数据库名 \l 或 SELECT datname FROM pg_database; 切换数据库 \c 数据库名
SQLSERVER 1.查询某个数据库中所有的表名: SELECT Name FROM SysObjects Where XType='U' ORDER BY Name 2.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name