这个是应用查询的SQL示例,每次查询参数都一样: select `fi_tid` as `fi_tid`, `carrier_flight_no` as `carrier_flight_no`, `from_code` as `from_code`, `to_code` as `to_code`, `flight_date` as `flight_date` ( select COUNT(*) from ( select `fi_tid` as `fi_tid`, `carrier_flight_no` as `carrier_flight_no`, `from_code` as `from_code`, `to_code` as `to_code`, `flight_date` as `flight_date` from `v_flight_trends_info_1 ` where (`carrier_flight_no` = '***' and `from_code` = '***' and `flight_date` = '***')) TOTAL_COLUMN_SQL) as TOTAL_ROWS__ from `v_flight_trends_info_1 ` where (`carrier_flight_no` = '***' and `from_code` = '***' and `flight_date` = '***') order by `plan_departure_time` asc limit 0,10 以下是OB视图创建sql示例(脱敏后): create view v_XXXXXX as select tid as fi_tid, carrier_flight_no as carrier_flight_no, from_code as from_code, to_code as to_code, substring(flight_date,1,10) as flight_date, case when fi_from_code <> fi_to_code and fi_to_code = 'XX' then 'A' when fi_from_code <> fi_to_code and fi_from_code = 'XX' then 'D' end as departure_or_arrival, case when international = 1 then 'D' when international = 2 then 'I' end as international, share_flight_no as share_flight_no, concat(fi.fi_departure_terminal,',',fi.fi_arrive_terminal) as terminal from aaaa fi left join (select mfi_flt_tid, GROUP_CONCAT(mfi_market_flight_no SEPARATOR ',') as share_flight_no from bbb mfi where mfi_market_flight_no not like '%XX%' and status <> 0 and mfi.mfi_flight_date >= DATE_SUB(current_date, INTERVAL 7 day) and mfi.mfi_flight_date <= DATE_add(current_date, INTERVAL 7 day) group by mfi_flt_tid) share on share.mfi_flt_tid = fi.tid where fi.fi_plane_tid is not null and status = 1 and fi.flight_date >= DATE_SUB(current_date, INTERVAL 7 day) and fi.flight_date <= DATE_add(current_date, INTERVAL 0 day)