MySQL操作语句记录

Mysql实际使用过程中用到的执行语句记录:

SELECT 语句

//将whs_material表中符合条件M_TYPE=3和M_STATUS=0的所有M_ID列出来
SELECT M_ID FROM whs_material WHERE M_TYPE=3 AND M_STATUS=0

//按日期的降序排列并且只显示前面10条
SELECT * FROM ivm_changerecord WHERE S_CODE=600009 ORDER BY T_DATETIME DESC LIMIT 10

//多字段排序示例
SELECT * FROM students st ORDER BY st.sAge ASC, st.sGrade DESC, st.sStuId DESC;


ALTER语句

ALTER TABLE group_capacity INT NULL 0 COMMENT '群组配额', 

insert into语句

向表里插入数值
insert into `whs_inventory_info` (`M_ID`, `ST_ID`, `LC_ID`, `I_GOOD_QTY`, `I_BAD_QTY`, `I_UPDATE_PERSON`, `I_UPDATE_TIME`) values('M2109116','ST2111003','LC2112025','2','0','U2002001','2023-05-25 11:19:49');

delete语句

//删除whs_inventory_info里的所有数值,但不影响表结构
DELETE FROM whs_inventory_info 

你可能感兴趣的:(数据库,mysql,数据库)