Obsidian/Recognition/Work Related/1.업무메모/2022.04/2022-04-11.md

1.8 KiB

SELECT * FROM tmp_request

SELECT count(*) FROM tmp_request WHERE packet1 IN ('28', '30') ;

SELECT packet5 FROM tmp_request GROUP BY packet5 HAVING mod(count(packet5), 2) <> 0

SELECT * FROM TMP_REQUEST tr WHERE PACKET5 = '20220131101323192'

-- 요청O, 응답 X 20220130194248555, MD101 20220130192056549, MD201


-- 응답 o, 송신 X

-- 선박국자료중 해안국 실 데이터 없는것 SELECT * FROM TMP_REQUEST tr WHERE NOT EXISTS ( SELECT 'o' FROM TB_PASSIVLC_REQUST WHERE MSSAGE_ID = tr.PACKET5 )

-- 선박국자료중 데이터 전송 실패 /* MD005 : 미사용모뎀 76건 MD105 : 미사용모뎀 76건 MD201 : 2022.02.02 고흥 1건

  • */ SELECT * FROM TMP_REQUEST tr WHERE PACKET1 = '30' AND PACKET8 LIKE '0%' AND PACKET2 = 'MD005'

-- 선박국자료중 데이터 전송 성공 SELECT * FROM TMP_REQUEST tr WHERE PACKET1 = '30' AND PACKET8 LIKE '1%'

-- 선박국 전송 성공자료중 해안국 실패컨 SELECT * FROM TB_PASSIVLC_REQUST WHERE MSSAGE_ID IN ( SELECT packet5 FROM TMP_REQUEST tr WHERE PACKET1 = '30' AND PACKET8 LIKE '1%' ) AND PROCESS IN (8,9)

-- 해안국 자료의 특정 선박 실패자료 확인 (해안국DB) SELECT * FROM TB_PASSIVLC_REQUST WHERE mmsi = '440109210' AND to_char(SND_DT , 'yyyymmdd') LIKE '20220202%' AND MSSAGE_ID = '20220131101323192' ORDER BY SND_DT

-- 해안국 자료의 특정 선박 실패자료 확인 (선박국자료) SELECT * FROM TMP_REQUEST tr WHERE PACKET5 = '20220131101323192'


-- 특정선박 수동위치 응답 데이터 확인

SELECT max(REPORT_DT) FROM TB_PASSIVLC_RSPNS WHERE slot_no = '934'

SELECT * FROM TB_PASSIVLC_RSPNS WHERE slot_no = '934' AND to_char(REPORT_DT , 'yyyymmdd') LIKE '20220310%'