SQL基础

 

SELECT

SELECT [columns] FROM [tables] WHERE [search_condition]

        ORDER BY [order_expression ASC | DESC]

例:

取得前面的100个数据

SELECT TOP 100 * FROM Sales ORDER BY ord_date DESC

Select * from store where store_name like %book%

查询包含了book的名称

Select * from staor where store_name like [abcd]%

查询所有以a,b,c,d开头的名称

更新:

UPDATE [table] SET [update_expression] WHERE [search_condition]

例:

UPDATE Authors SET phone=’408 496-2222’ WHERE state=’CA’

插入

INSERT INTO [table] ([column_list]) VALUES ([value_list])

你可能感兴趣的:(sql)