0
CREATE VIEW tcs.meter_data_eb2 AS
select ar.created_date AS created_date,
p.id AS parameter_id,
p.parameter_name AS parameter_name,
ar.parameter_value AS parameter_value,
m.meter_primary_id AS meter_id,
m.meter_name AS meter_name
m.meter_code As meter_code
from tcs.parameter_values_archieve ar
inner join tcs.parameter_master p on p.id = ar.parameter_id
inner join tcs.meter_primary_master m on m.meter_primary_id = ar.meter_id
inner join tcs.meter_master mm on mm.meter_primary_id = m.meter_primary_id;
此查詢有什麼問題?使用連接創建視圖
它給錯誤:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm.meter_code As meter_code from tcs.parameter_values_archieve ar inner join tc' at line 8
的,什麼是錯誤消息 –
它的錯誤給你? –
@jw錯誤消息....「您的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以便在'm.meter_code'附近使用正確的語法作爲來自tcs.parameter_values_archieve ar的內部連接tc的meter_code '在第8行「 – user1896796