Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Tamvb17
.
Toggle Highlighting
SQL
SELECT MAX(CED.COLLECTED_EVENT_DATA_ID), MAX(CED.EIP_BINARY_TAG_ID), RET.DESCRIPTION, RET.USER_TYPE, (CED.PHASE_A), (CED.PHASE_B), (CED.PHASE_C), (CED.PHASE_0), DATE_FORMAT(CED.EVENT_TIME, '%d/%m/%Y %H:%i:%s'), RET.DESCRIPTION_EN, R.RECLOSER_NAME from collected_event_data CED join recloser_event_type RET on CED.eip_binary_tag_id = RET.ret_id_map join measurement_point_recloser MPR on MPR.measurement_point_recloser_id = CED.measurement_point_recloser_id join recloser R on R.recloser_id = MPR.recloser_id and R.type = RET.recloser_type AND ( R.PC_ID IN ( SELECT V.DEPT_ID FROM V_DEPARTMENT V WHERE V.DEPT_PATH LIKE '' ) OR R.Recloser_id IN ( select rd.Recloser_id from recloser_deapartment rd where rd.dept_id = '' ) ) where 1 = 1 AND R.recloser_name is not null AND DATE(CED.EVENT_TIME) >= date('') AND DATE(CED.EVENT_TIME) <= date('') and( ( CED.eip_binary_tag_id in (2, 4, 5, 7, 8) and RET.recloser_type = 1 ) -- Cooper FXB or ( CED.eip_binary_tag_id in ( 60002, 60004, 60005, 60008, 903, 910, 902, 909, 60255, 2680, 2483, 6000 ) and RET.recloser_type in (2, 3) ) -- NUlec ADVC, PTCC or ( CED.eip_binary_tag_id in (301, 302, 255, 0) and RET.recloser_type = 4 ) -- Heag or ( CED.eip_binary_tag_id in (475, 476) and RET.recloser_type = 5 ) -- Entec or ( CED.eip_binary_tag_id in (301, 302) and RET.recloser_type = 6 ) -- COOPER-F6 OR ( CED.eip_binary_tag_id IN (27, 28, 29, 30, 31, 32, 34, 35, 37, 38) AND RET.recloser_type = 9 ) -- NOJA OR ( CED.eip_binary_tag_id IN (1, 2, 407, 408, 90, 92) AND RET.recloser_type = 10 ) -- COOPER-FXD OR ( CED.eip_binary_tag_id IN (1, 2, 407, 408, 90, 92) AND RET.recloser_type = 11 ) -- COOPER-FXD 2.70 or ( CED.eip_binary_tag_id in (1, 2, 407, 408, 90, 92) and RET.recloser_type = 12 ) -- COOPER-FXD 3.1.19 or ( CED.eip_binary_tag_id in (27, 28, 29, 30, 31, 32, 34, 35, 37, 38) and RET.recloser_type = 13 ) -- NOJA 22KV or ( CED.eip_binary_tag_id in (27, 28, 29, 30, 31, 32, 34, 35, 37, 38) and RET.recloser_type = 14 ) -- NOJA 35KV or ( CED.eip_binary_tag_id in (701, 702) and RET.recloser_type = 240 ) -- LBS_SS ) GROUP BY R.RECLOSER_NAME, RET.DESCRIPTION, RET.USER_TYPE, CED.PHASE_A, CED.PHASE_B, CED.PHASE_C, CED.PHASE_0, CED.EVENT_TIME, RET.DESCRIPTION_EN ORDER BY CED.EVENT_TIME
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...