1
votes

I can run the select statement and get result in sqlite-manager (firefox plugin). Here is the sqlite db file,Cinfo is db name ,ipo is a table in it.
http://pan.baidu.com/s/1hqJuNa8

select   代码,上市日期, (julianday(date())-julianday(上市日期))/365 as years from ipo;

why i can't create view ?

create view  ipoage as  select   代码,上市日期, (julianday(date())-julianday(上市日期))/365 as years from ipo;

SQLiteManager: Likely SQL syntax error: create view test as
select 代码,上市日期, (julianday(date())-julianday(上市日期))/365 as years from ipo; [ no such table: main.ipo ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)

enter image description here

enter image description here

1
Are you sure that "ipo" and "ipo" are spelled with the same characters? - CL.

1 Answers

1
votes

I test and test,at last solved it.

create view  ipoage as  select   "代码","上市日期", (julianday(date())-julianday("上市日期"))/365 as years from ipo;

It is neccesary for chinese characters to be quoted in select statement when to create view in sqlite.