SQL2008搜索数据的命令

下面其实就是几个很常用的sql的查询语句,针对一些数据库的快速查询还是很有用的,具体如下:

1、建立索引语句

CREATE INDEX index_name ON [导入的数据名].[dbo].[表名] (字段名)

2、查询所有数据

select * from [导入的数据名].[dbo].[表名];

3、根据字段查询:

select * from [导入的数据名].[dbo].[表名] where 字段名 = '张三';

4、根据字段模糊查询:

select * from [导入的数据名].[dbo].[表名] where 字段名 like '420101_%';

This entry was posted in Technology and tagged , . Bookmark the permalink. 1,924 views

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>