2、向数据库表里插入数据,按照插入SQL语句insert into 执行。
3、插入完毕后,查询数据库表记录select 字段 from table。
4、查询数据库表t_user_info用户地址为空的记录select * from table from 字段 is null。
5、查询数据库表t_user_info用户电话不为空的记录,select * from table where 字段 is not null。
6、查询数据库表t_user_info电话不为空且地址为空的记录,select * from table where 字段 is not null and 字段 is null。
1、Oracle数据库:
select * from ‘数据库的名字’ where Table_Name='你要查询表的名字'
2、mysql查询表所有列名,并用逗号分隔:
SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ",")
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = '数据库的名字' AND TABLE_NAME = '你要查询表的名字'
扩展资料:
Oracle数据库其他查询语句:
1、查询所有表名:
select t.table_name from‘数据库的名字’;
2、查询所有字段名:
select t.column_name from ‘数据库的名字’;
3、查询指定表的所有字段名:
select t.column_name from ‘数据库的名字’ where t.table_name = '你要查询表的名字';
4、查询指定表的所有字段名和字段说明:
select t.column_name, t.column_name from‘数据库的名字’where t.table_name = '你要查询表的名字';
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)