-------------------------Windows Phone 7手机开发、.Net培训、期待与您交流! -------------------------
最近学习了一些基本SQL语句的用法 现留下 备查 ~
创建数据库 Create DATABASE databasename
删除数据库 drop database dbname
创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
删除表 drop table tabname
以下摘自 百度百科 ~ 留下备查
简单基本的sql语句
(1) 数据记录筛选: sql="select * from 数据表 where 字段名=字段值 order by 字段名 [desc]" sql="select * from 数据表 where 字段名 like '%字段值%' order by 字段名 [desc]" sql="select top 10 * from 数据表 where 字段名=字段值 order by 字段名 [desc]" sql="select top 10 * from 数据表 order by 字段名 [desc]" sql="select * from 数据表 where 字段名 in ('值1','值2','值3')" sql="select * from 数据表 where 字段名 between 值1 and 值2" (2) 更新数据记录: sql="update 数据表 set 字段名=字段值 where 条件表达式" sql="update 数据表 set 字段1=值1,字段2=值2 ……