遥测数据导出sql

SELECT
(select codename from CD_BGStation where CodeValue=StationCode)as 监测点位,case when [DETECTIONSTATE]=1 then '合格' when [DETECTIONSTATE]=2 then '无效' else '不合格'end as 检测结果,[PASSDATETIME]as 检测时间,[VLPN]as 车牌号,
(select CodeName from CD_VLPNColor where CodeValue= [VLPNCOLOR])as 车牌颜色,cartype 车辆类型,
case when FUELTYPE is null then '其他' else (select codename from CD_FuelType where codevalue = FUELTYPE) end as 燃料类型,
[CO]as '一氧化碳(%)',[NO]as '一氧化氮(ppm)',[SF]as '不透光烟',[HC]as 'HC浓度值(ppm)',[CO2]as '二氧化碳(%)',[VSP]as 比功率,[SPEED]as '车辆速度(km/h)',
[ACCELERATION]as '加速度(km/h*s)',[humidity]as '湿度(%)',[temperature]as '温度(℃)',[atmosphere] as '大气压力(hPa)',[WINDSPEED] as '风速(m/s)',[WINDDIRECTION] as '风向'
from REMOTEDETECTION where 1=1
and PASSDATETIME>='2018/10/1 00:00' and PASSDATETIME<'2018/11/01 00:00'
--and StationCode='139001003'
--and FUELTYPE='B'
order by PASSDATETIME

posted @ 2020-01-15 09:18  不再犯错  阅读(...)  评论(...编辑  收藏