CREATE TABLE zhangwu(
id INT PRIMARY KEY AUTO_INCREMENT ,
zname VARCHAR (20),
money DOUBLE ,
parent VARCHAR (20)
)
INSERT INTO zhangwu(id,zname,money,parent) VALUES
(1,'吃饭支出',247,'支出'),
(2,'工资收入',12345,'收入'),
(3,'服装支出',1000,'支出'),
(4,'吃饭支出',325,'支出'),
(5,'股票收入',8000,'收入'),
(6,'打麻将支出',8000,'支出'),
(7,NULL,5000,'支出')
SELECT * FROM zhangwu ORDER BY money DESC
SELECT * FROM zhangwu WHERE zname LIKE '%支出%' |
|