Sql语句学习 一. select playerId, count(playerId) as num from OperateLog_$i where playerId > 0 and rootId = 12 and typeId = 12156 and actionTime >= 1381509000000 and actionTime <= 1381511220000 group by playerId having count(*) > 2; this-- > 可以计…
在学习动态SQL语句之前,首先必须对条件查询有一定了解,先来学习如何向IBatis.Net的映射文件里传入参数吧. 一.条件查询 1.传递单个参数 如根据Id查询: <select id="SelectOnePerson" resultMap="PersonModel"> <!--其中#Id就是传入的参数--> select * from person where Id = #Id# </select> 调用的时候,只需要传入对应…
merge into when matched then... when not mached then... merge into t_road_pre_parameter a from dual ) b on (a.TIME_SEGMENT=? and a.ROAD_ID=? and a.RS_INDEX=? and a.FLAG=) when matched then update set a.week_num=?, a.temperature = ?, a.if_rain…
从外部EXCEl文件导入sqlserver数据库操作命令 reconfigure reconfigure go select * into abc1_1 from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0;HDR=YES;DATABASE=文件路径',SQLResults$) 注意:文件路径到excel下某个固定的sheet,sheet名字不要有空格 数据库合并 insert into [新数据库名(合并后的)] select [字段] F…