SELECT  userid, gps_x, gps_y ,routescode, DATE_FORMAT(updatedate, '%Y-%m-%d %h:%i:%s') as updatedate
FROM  test.gpsinfo 
WHERE SEQ IN (
    SELECT  max(seq) 
    FROM  test.gpsinfo 
    GROUP BY userid
);

 

 SELECT  max(seq)  
    FROM  test.gpsinfo  
    GROUP BY userid  으로 userid 의 max(seq) 값을 찾고 max(seq)인 값의 데이터를 가져옴

'프로그래밍 > sql,php' 카테고리의 다른 글

sqlite 컬럼검사  (0) 2019.07.19
DATE_FORMAT , INTERVAL , TIMESTAMP  (0) 2019.05.23
sql> PL/SQL 2일차  (0) 2018.11.22
sql>오라클 DB수업 6일차 + PL/SQL START  (0) 2018.11.21
sql> 오라클db 수업 4일차  (0) 2018.11.19

mysql DATA_FORMAT 예제

 

SELECT userid, gps_x, gps_y ,routescode, DATE_FORMAT(updatedate, '%Y-%m-%d %h:%i:%s') as updatedate
FROM  test.gpsinfo 
WHERE updatedate > date_sub(now(),interval 10 second);

 

DB Query updatedate 는 TIMESTAMP입니다.

10초전~현재까지의 업데이트 데이터 DATE_FORMAT을 사용하면 String형으로 바로 받아 사용가능함

'프로그래밍 > sql,php' 카테고리의 다른 글

sqlite 컬럼검사  (0) 2019.07.19
MYSQL MAX 쿼리를 이용하여  (0) 2019.05.23
sql> PL/SQL 2일차  (0) 2018.11.22
sql>오라클 DB수업 6일차 + PL/SQL START  (0) 2018.11.21
sql> 오라클db 수업 4일차  (0) 2018.11.19

eclipse 마켓 검색시 svn 나오지 않고 웹브러우저를 통하여 끌어서 다운로드 할경우에도 

 

the following solutions are not compatible with this version of eclipse 라는 에러문구와 함께 다운로드가 안되는 경우가 있습니다.

 

그럴땐 Help -> Install New Software 를 들어가서 

 

add 버튼을 클릭후 

name : update 

Location: http://download.eclipse.org/technology/subversive/4.0/update-site/

 

${project.name}

 

download.eclipse.org

을 입력하시고 검색창에 svn 을 입력하시어 다운로드 하시면 됩니다.

'프로그래밍 > Java,eclipse' 카테고리의 다른 글

http multipartRequest 사진전송,파일전송 (저장용)  (0) 2021.07.15
이해하기 폴리곤 알고리즘  (0) 2019.05.23
배경 테마 바꾸기  (0) 2018.10.25
연산자의 종류  (0) 2018.10.25
자바 자료형의 종류  (0) 2018.10.25

HTML


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById('canvas');
if(canvas.getContext){
var context = canvas.getContext('2d');
context.beginPath();
//시작점을 (50,200)으로 옮김
context.moveTo(50,200);
//조절점 지정
context.bezierCurveTo(90,50,310,50,350,200);
context.stroke();
}else{
alert('브라우저가 캔버스를 지원하지 않습니다.');
}
};
</script>
</head>
<body>
<canvas id="canvas" width="500" height="300"></canvas>
<br><br>
<img src="../files/exp_02.gif">
</body>
</html>

결과




HTML


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById('canvas');
if(canvas.getContext){
var context = canvas.getContext('2d');
context.beginPath();
//시작점을 (50,200)으로 옮김
context.moveTo(50,200);
//조절점 지정
//(200,50)을 조절점으로 하여 현재 위치 (50,200)에서 (350,200)까지 곡선을 그림
context.quadraticCurveTo(200,50,350,200);
context.stroke();
}else{
alert('브라우저가 캔버스를 지원하지 않습니다.');
}
};
</script>
</head>
<body>
<canvas id="canvas" width="500" height="300"></canvas>
<br><br>
<img src="../files/exp_01.gif">
</body>
</html>

결과





HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById('canvas');
if(canvas.getContext){
var context = canvas.getContext('2d');
context.fillStyle = 'rgb(200,0,0)';
context.fillRect(10,10,100,100);
//16진수 색상 코드
context.fillStyle='#0c30c3';
context.fillRect(50,50,100,100);
context.beginPath();
context.arc(250,90,80,0,Math.PI*2,true);
context.closePath();
context.fillStyle = 'Yellow';
context.strokeStyle='blue';
context.fill();
context.stroke();
}else{
alert('브라우저가 캔버스를 지원하지 않습니다.');
}
};
</script>
</head>
<body>
<canvas id="canvas" width="500" height="300"></canvas>
</body>
</html>


결과





HTML


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById('canvas');
if(canvas.getContext){
var context = canvas.getContext('2d');
/*
arc메서드에서 각도는 도(degree)로 표시하지 않고 라디안 값으로 표기함
1라디안 은 180/Math.PI, 60도 (Math.PI/180)*60 , 360도 (Math.PI *2)
1.5파이(270도)
|
|
|
1파이(180도) ---중심점 --- 0파이,2파이(0도,260도)
|
|
|
0.5파이(90도)
//(70,70)에서 반시계방향으로 반지름 20픽셀인 원을 그리는데 , 60도 까지만 그리고 태두리만 표시
*/
context.beginPath();
context.arc(70,70,20,0,(Math.PI/180)*60,true);
context.stroke();
context.beginPath();
context.arc(130,110,50,0,Math.PI*2,true);
context.closePath(); //360e도 이기때문에 생략 가능
context.fillStyle ='rgb(0,200,200)';
context.fill();
context.stroke();
context.beginPath();
context.arc(190,70,20,(Math.PI/180)*110,(Math.PI/180)*170,true);
context.stroke();
}else{
alert('브라우저가 캔버스를 지원하지 않습니다.');
}
};
</script>
</head>
<body>
<canvas id="canvas" width="500" height="300"></canvas>
</body>
</html>

결과







































HTML


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById('canvas');
if(canvas.getContext){
var context = canvas.getContext('2d');
//색이 칠해진 삼각형
context.beginPath();
context.moveTo(50,50);
context.lineTo(150,50);
context.lineTo(50,150);
context.closePath();
//색칠하기
context.fill();
context.beginPath();
context.moveTo(80,80);
context.lineTo(200,100);
context.lineTo(100,200);
context.closePath();
//선 색칠하기
context.strokeStyle='rgb(200,0,0)'
//테두리 그리기
context.stroke();
}else{
alert('브라우저가 캔버스를 지원하지 않습니다.');
}
};
</script>
</head>
<body>
<canvas id="canvas" width="500" height="300"></canvas>
</body>
</html>


결과







+ Recent posts