数据的高级查询

—数据的高级查询–注: –以以下列子为例 create table product ( p_id int primary key identity, p_name varchar(150), p_type int, p_desc varchar(400),–description描述 p_price money, p_style varchar(50) )  insert into product(p_name,p_type,p_desc,p_price,p_style) select ‘古筝’,1,’菊花台’,540.5,’民族乐器’ union select ‘二胡’,1,’菊花’,54.5,’民族乐器’ union select ‘扬琴’,2,’asd’,180,’民族乐器’ union select ‘琵琶’,2,’out5′,230,’民族乐器’ union select ‘钹’,3,’out1′,1888.8,’民族乐器’ union select ‘笛子’,1,null,540.5,’民族乐器’ union select ‘板胡’,1,’花菊台’,1000,’民族乐器’¦lt;br />  select * from product –使用like、between、in进行查询 –使用like进行模糊查询 select * from product where p_desc like ‘菊%’ –注:%可以代替任意长度的字符 select * from product where p_desc like ‘菊_’ –注:_代替一个字符 select * from product where p_desc like ‘out[5, 1]‘ –注:[]括号中出现的任意一个字符 select * [...]
posted @ 2008-11-14 11:44  大鹏ME  阅读(114)  评论(0编辑  收藏  举报