`
文章列表
     今天遇到个需求,要匹配两个表, 但是关联的字段,在另一个表中是放在一个字段中用分号分割的 怎么全部匹配呢? 后来在网上搜到了, 记录下 SELECT cp.ES_EXTNUMBER,        cp.ES_AGENTID,        cp.ES_CHSTATESTR,        (sysdate-cp.ES_STARTDATETIME)*24*3600 es_times,        REGEXP_SUBSTR(CP.ES_GROUP, '[^;]+', 1, L) AS ES_GROUP        ,L FROM aladdinpbx_exts ...

sql行转列

    博客分类:
  • SQL
select kf_name, MAX(decode(trim(tab1.ACTUALSTAGE),'拜访','拜访',null)) 第一阶段, MAX(decode(trim(tab1.ACTUALSTAGE),'送礼','送礼',null)) 第二阶段, MAX(decode(trim(tab1.ACTUALSTAGE),'成功','成功','失败','失败',null)) 第三阶段 from(select A.kf_name,B.name,B.ACTUALSTAGE from xsj_khzd A left join xs_zpcustomer_b B ...
<html> <head> <title>天涯网痕</title> <style type="text/css"> #tip {position: absolute;right: 0px;bottom: 0px;height: 0px;width: 250px;border: 1px solid #CCCCCC;background-color: #e0ecff; padding: 1px;overflow:hidden;display:none;font-size:12px ...
function showTime () { var tick = new Date(); var hours = tick.getHours(); var minutes = tick.getMinutes(); var seconds = tick.getSeconds(); var day = tick.getDay(); var month = tick.getMonth() + 1; var date = tick.getDate(); var ...
1. js验证radio是否选择 <script language="javascript"> function checkform(obj) { for(i=0;i<obj.oo.length;i++) if(obj.oo[i].checked==true) return true; alert("请选择")return false; } </script> <form id="form1" name=& ...
//between and @Override public PageInfo<T> queryInfoAndLikes(PageInfo<T> pageInfo, Map<String, String> map, String propertyName, Object minObject, Object maxObject) throws DataAccessException { if (pageInfo == null) { pageInfo = new PageInfo<T>(); } ...
//Hibernate查询 @Repository("crb_bgkDao") public class Crb_bgkDaoImpl extends BaseDaoImpl<Crb_bgk> implements ICrb_bgkDao { @Override public PageInfo<Crb_bgk> queryByPersonAndHospital(PageInfo<Crb_bgk> pageInfo, Hospital hospital, Person person, String bqfl) ...
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>EB页面导出为EXCEL文档的方法</title> <script type="text/javascript"> <!-- download function saveCode(obj) {           var winname = window.open('', ...

Hibernate

 
: QBE (Query By Example)   Criteria cri = session.createCriteria(Student.class);   cri.add(Example.create(s)); //s是一个Student对象   list cri.list();     实质:创建一个模版,比如我有一个表serial有一个 giftortoy字段,我设置serial.setgifttoy("2"),         则这个表中的所有的giftortoy为2的数据都会出来 2: QBC (Query By Criteria) 主要有Criteri ...
//需要注意的是:月份是从0开始的,比如说如果输入5的话,实际上显示的是4月份的最后一天,千万不要搞错了哦 public static String getLastDayOfMonth(int year, int month) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, month); cal.set ...
UPDATE hj_cy_jws u set yyid = ( SELECT hj.yyid FROM hj_cy_jws jw JOIN hj_cy hj ON jw.grid = hj.grid WHERE u.id = jw.id ) UPDATE hj_cy_jws u set yyid = ( SELECT DISTINCT hj.yyid FROM h ...
Global site tag (gtag.js) - Google Analytics