2016년 4월 21일 목요일

그룹별 최신데이터 가져오기

SELECT a, b, c FROM ( SELECT a, b, c ROW_NUMBER() OVER (PARTITION BY code ORDER By date desc ) as ROW FROM aa ) q WHERE ROW =1 code별 그룹지어서 date 가 제일 최신인 데이터 1개만 가지고오는 ...
Share:

2016년 4월 8일 금요일

mysql 같은 테이블 값 불러와서 넣는법

*insert( SELECT * FROM ( SELECT 컬럼 FROM 테이블 WHERE ID= #{id} ) as temp )*updateupdate table set column=1 where column2 IN (select column from table)이렇게 하면 오류나지만 아래 처럼하면 사용가능update table set column=1 where column2 IN (select * from (select column from table) as temp)...
Share:

ajax 값 한글데이터 물음표 현상

* java1.JSON으로 주고받을시produces = "application/json; charset=utf8" 추가2.JSONObject resultMsg =new JSONObject();List<aa> value= aa.list(valVO);resultMsg.put("value", value); return resultMsg.toString();* ajax1.$.ajax({                                     url: "${contextPath}/aa/aa/abc",    ...
Share:

2016년 4월 4일 월요일

bootstrap datepicker 사용법

1.Import<link rel="stylesheet" type="text/css" href="${contextPath}/resources/bootstrap/css/datepicker3.css" /><script type="text/javascript" src="${contextPath}/resources/bootstrap/js/bootstrap-datepicker.js"></script><script type="text/javascript" src="${contextPath}/resources/bootstrap/js/bootstrap-datepicker.kr.js"></script>2. js$('#dateRangePicker').datepicker({...