【正文】
//查詢系統(tǒng)時間 ? 更新內(nèi)容 命令: update tbl set 字段 =值 where 條件 ? 刪除記錄 delete from tbl where 條件 truncate tbl //刪除表中所有記錄 。 查詢數(shù)據(jù) select 字段 from tbl where 條件 [limit start,rows] MYSQL數(shù)據(jù)庫基礎(chǔ) 例: select * from tbl limit 0,3 (1)基本查詢 select *[字段 ] from tbl (2)條件查詢 select * from tbl where 字段 條件 值 select * from tbl where username like ‘a(chǎn)%’ select * from tbl where (age20 and scrore80) or age20 MYSQL數(shù)據(jù)庫基礎(chǔ) (3) 多表查詢 select * from tbl1,tbl2 多表查詢滿足迪卡爾積 (4) 排序查詢 select * from tbl order by id desc[asc] //按大小排序 select * from tbl group by password //按類排序 select count(*) as t group by password //按類統(tǒng)計 select * from tbl group by password having username=‘a(chǎn)hut’ //根據(jù)條件按類統(tǒng)計 MYSQL數(shù)據(jù)庫基礎(chǔ) (5) 查詢非字段 select 6*5。 MYSQL數(shù)據(jù)庫基礎(chǔ) ? 查看數(shù)據(jù)庫 show命令 顯示數(shù)據(jù)庫內(nèi)容 show databases 列出所有可供使用的數(shù)據(jù)庫名 show tables 列出當(dāng)前數(shù)據(jù)庫中所有的表信息 show columns from table 列出表中所有字段信息 describe命令 查看指定表的詳細(xì)設(shè)計信息 describe tbl。 MYSQL數(shù)據(jù)庫基礎(chǔ) M