亲测有效
1、(1)查询表中某字段有几种类型,及每种类型有多少个数
select DISTINCT name user_name,count(*) num from patient GROUP BY name
(2)查询表中某字段类型共有几种
select count(distinct name) from patient 查个数select DISTINCT name user_name from patient 看类型
2、insert 一次插入多行数据(每行数据用括号分隔)
INSERT into patient (`id`, `name`)VALUES('1112', '小可'),('1113', '小点')
3、查询表前几行
(mysql)
select * from patient LIMIT 2,5 查询第3,4,5行数据
(mysql)
select * from patient LIMIT 5 查询前5行数据
(oracle)
SELECT * FROM patient where rownum<5 查询前5行数据