第九章 数据查询基础1.记录集:记录集是符合查询条件的记录组织在一起的类似于表结构的查询结果2.使用select语句进行查询语法: select 列名 from 表名 where 查询条件表达式 order by 排序的列名 【asc或desc】 1.查询所有的数据行和列 select * fro....
分类:
数据库 时间:
2015-11-04 21:27:05
阅读次数:
176
尊重别人是一种美德,受人尊重是一种幸福。一、查询一部分1 eg2 select studentName 学生姓名,address 地址 from student3 where studentNO=2332二、显示中文名1 别名方案一2 select msgAu...
分类:
其他好文 时间:
2015-11-04 21:03:07
阅读次数:
288
示例代码如下:create table tmp as select min(主键) as col1 from 去重表名 GROUP BY 去重字段;delete from 去重表名 where 主键 not in (select col1 from tmp); drop table tmp;
分类:
数据库 时间:
2015-11-04 19:14:36
阅读次数:
203
SELECT TOP 1000 [ID] ,[SourcePageID] ,[PlatformType] ,[CreateTime] FROM [home_sendorder].[dbo].[ApplyUser]where [PlatformType]=2 and [CreateTime]>='20...
分类:
数据库 时间:
2015-11-04 17:51:50
阅读次数:
197
特别注意,经实践:此方法的ViewBag的名称必须和new SelectList()中的最后一个参数,即下拉框的默认值的名称必须相同,如:ViewBag.Title = WebConst.UnSelect.Union(new SelectList(WebConst.Dictionary.Where(...
分类:
其他好文 时间:
2015-11-04 11:15:03
阅读次数:
232
数据表中根据一列数据进行数据去重:例如有表名为T_BUFFET_ORDER,包含三个字段:phone,month,status。现在phone字段有重复号码,根据phone去重: delete?from??T_BUFFET_ORDER?where?phone?in?(select...
分类:
数据库 时间:
2015-11-03 18:03:32
阅读次数:
224
一、可用SYS登录,二、查锁session_ID查找存储过程OPERATIONDATA_IMP被哪些session锁住而无法编译select * FROM dba_ddl_locks where name =upper('OPERATIONDATA_IMP');三、查出sid serial#从而得到...
分类:
数据库 时间:
2015-11-03 17:27:12
阅读次数:
248
delete from userinfo where userinfo guid in (select guid from personinfo where departid = 部门id);//删除人员信息delete from personinfo where departid = 部门id;/...
分类:
数据库 时间:
2015-11-03 17:20:12
阅读次数:
154
1、查询每个部门的总人数select deptId,COUNT(*) as sum from bas_dept group by deptId;select返回集字段中,这些字段要么就要包含在Group By语句的后面(deptId),作为分组的依据;要么就要被包含在聚合函数中(count(*)聚合...
分类:
其他好文 时间:
2015-11-03 10:30:05
阅读次数:
135
技术原理编辑索引是对数据库表中一个或多个列(例如,employee 表的姓名 (name) 列)的值进行排序的结构。如果想按特定职员的姓来查找他或她,则与在表中搜索所有的行相比,索引有助于更快地获取信息。例如这样一个查询:select * from table1 where id=10000。如果没...
分类:
其他好文 时间:
2015-11-02 23:06:48
阅读次数:
397