Sql server之路 (一)基础学习

Sql server之路 (一)基础学习

查询

1.Select * from表名  

2.Select 字段1,字段2,from表名

3.Select 字段1,字段2,...from表名 where 字段1 in('内容')

插入

1.insert into 表名(字段1,字段2...)values('内容1','内容2'...)

2.insert into 表名(字段1,字段2...) select (字段1,字段2...) from 表名 where 字段1 in('内容')    

INSERT INTO Store_Information (Store_Name, Sales, Txn_Date) SELECT store_name, Sales, Txn_Date FROM Sales_Information WHERE Year (Txn_Date) = 1998

更新

1.update 表名 set 字段1=内容1 where 字段2 in('内容2') and 字段3 in('内容3')

UPDATE Store_Information SET Sales = 500 WHERE Store_Name = 'Los Angeles'  AND Txn_Date = 'Jan-08-1999';

2.update 表名 set 字段1=内容1,字段2=内容2 where 字段3 in('内容3') and 字段4 in('内容4')

删除

1.delete from 表名 where 字段1 in ('内容1')

DELETE FROM Store_Information WHERE Store_Name = 'Los Angeles';

SQL 基本语法 http://www.1keydata.com/cn/sql/sql-delete.php

ADO.NET连接SQL Server数据库 http://developer.51cto.com/art/201105/263291.htm

编写 SQL 查询:让我们从基础知识开始 http://www.microsoft.com/china/msdn/library/data/sqlserver/ssequerybasics.mspx?mfr=true

简单十步让你全面理解SQL http://www.admin10000.com/document/3412.html

c# 数据库操作 读写数据库 http://blog.csdn.net/watkinsong/article/details/6758146

System.Data.SQLite数据库简介 http://blog.csdn.net/zhoufoxcn/article/details/5464443

http://zwt7610.blog.51cto.com/1716831/408100  http://blog.csdn.net/mr_wanter/article/details/13003915

 http://blogs.msdn.com/b/aspnetue/archive/2012/08/14/sql-server-connection-strings-for-asp-net-web-applications.aspx

 Sql server之路 (一)基础学习Sql server之路 (一)基础学习