列转行 select prd_no_chg_y, SUBSTRING(t.prd_no_chg_y, number ,CHARINDEX(';',t.prd_no_chg_y+';',number)-number) prd_no_chg from tb t,master..spt_values s ...
分类:
数据库 时间:
2020-11-21 12:37:40
阅读次数:
11
如果直接写 select * from user where id <> 217;mybatis就会报语法错误,<>特殊字符需要转义 如下 select * from user where id <> 217; 使用Mybatis的时候,特殊字符需进行转义,如<> <>&am ...
分类:
数据库 时间:
2020-11-21 12:07:00
阅读次数:
13
SELECT LISTAGG(fun_getaaa103('AAE140', a.aae140), ',') WITHIN GROUP(ORDER BY a.aae140) AS aae140str FROM ac02 a where a.aac001 = '10002070436'; SELECT ...
分类:
其他好文 时间:
2020-11-20 12:07:47
阅读次数:
6
1.视图 1.1 什么是视图? 视图实际上是一张虚拟表,其本身不存储数据。 相当于一张表或多张表的数据结果集 数据表复杂的情况下,可以把查询结果放在虚拟表中,提升效率 1.2如何创建、更新、删除视图 创建 CREATE VIEW view_name AS SELECT column1 FROM ta ...
分类:
数据库 时间:
2020-11-20 11:56:03
阅读次数:
13
最近在sql使用中,发现 case when 的功能相当强大。 可以根据现有字段定义新的字段,可以对新字段进行排序等等。 下面简单举例说明。 用来测试的数据表内容如下: mysql> select * from test_student; + + + + + + | id | name | age ...
分类:
数据库 时间:
2020-11-20 11:53:29
阅读次数:
10
procedure Tfrm_rk.DBGrid1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then { 判断是按执行键} if not (ActiveControl is TDbgrid) Then Begin { 不是在 ...
分类:
移动开发 时间:
2020-11-20 11:49:19
阅读次数:
18
1. 查询工资高于1号部门平均工资的员工信息 select avg(sal) from emp where deptno=1; select * from emp where sal>2330; 合并上面两条SQL select * from emp where sal>(select avg(sa ...
分类:
其他好文 时间:
2020-11-20 11:37:51
阅读次数:
4
在实际项目开发中,我们经常需要在项目构建文件监听,已备在项目的源码发生变化时候时,自动重构出新的输出文件。配置代码如下:webpack.config.jsmodule.export={watch:true,watchOption:{ignored:/node_modules///忽略不需要监听的文件aggregationTimeout:300,poll:1000//默认每秒访问1000}}在执行时
分类:
Web程序 时间:
2020-11-20 11:18:24
阅读次数:
11
var records = studyRecords.GroupBy(x => x.StudyTime.Date).Select(y => new { date = y.Key, seconds = y.Sum(x => x.StudySeconds) }); ...
防止sql注入 char *sqlite3_mprintf(const char*,...); void sqlite3_free(void*); sqlite3_mprintf 用来代替sprintf 来防止sql注入。 sqlite3_mprintf的内部操作: ?会将%Q,替换成给定的字符串。 ...
分类:
数据库 时间:
2020-11-19 12:42:05
阅读次数:
11