我在 sqlite - android 中创建了两个视图,但是当我创建第二个视图时,我得到了错误
没有这样的库:template_contact_info.tmp_text 作为文本,template_contact_info.tmp_link 作为链接
即使这两个列都存在于 template_contact_info 并且 template_contact_view 已成功创建。但仍然不知道为什么我得到没有这样的列错误。
这是视图的代码
第一个视图
db.execSQL("CREATE VIEW IF NOT EXISTS
template_contact_info AS
SELECT
template_info.tmp_text as tmp_text ,
template_info.tmp_link as tmp_link ,
template_info.tmp_id as temp_id ,
template_info.tmp_type as tmp_type ,
template_contact._id as _id
from template_info , template_contact
where template_info.tmp_id = template_contact.tmp_id");
第二个视图//这里我收到一个错误
db.execSQL("CREATE VIEW IF NOT EXISTS
template_contact_assign AS SELECT
contact_info.c_number as number ,
contact_info.c_name as name ,
contact_info.c_id as conid,
contact_info._id as cid,
template_contact_info.tmp_type as type ,
template_contact_info.temp_id as tempid ,
template_contact_info.tmp_text as text ,
template_contact_info.tmp_link as link
FROM contact_info LEFT JOIN template_contact_info
ON contact_info._id = template_contact_info._id");