o一、查询语句(select):
Select语句主要被用来对数据库进行查询并返回符合用户
查询标准的结果数据。
select column1 [, column2,etc] from tablename
where condition;
([ ]表示可选项)
o例如:查询cq_user表中所有PM号,只显示id跟name字段:
Select id,name from cq_user where name like ‘%[PM]’ ;
如果要求显示全部字段则写为:
Select * from cq_user where name like ‘%[PM]’ ;
o
o将cq_generator表中所有怪物类型(npctype)为900的记录找出来并按照id从大到小的顺序排列。
o
o
oSelect * from cq_generator where npctype = 900 order by id desc
o