从带参数的select中创建视图

时间:2013-12-03 10:15:03

标签: mysql view parameters

我想从这个'select'

创建视图
CREATE VIEW `ste_15` AS
set @n:=0;
select 
       instr_name,
       min(instr_bid) as minBid,
       max(instr_bid) as maxBid,
       avg(instr_bid) as avgBid,
       STR_TO_DATE(instr_modifie,'%c/%d/%Y %T') + interval @n*15 minute as timescale,@n:=@n+1
from dfhistory
where
instr_modifie is not null
group by instr_modifie;

但mysql在'set @n:= 0 ....'附近给出了语法错误。如何使用参数创建视图?

0 个答案:

没有答案