1
我試圖通過webpy框架來執行Sqlite3查詢。查詢在SQLiteManager中起作用。但與web.db我得到「sqlite3.OperationalError沒有這樣的列a.id」。 這是一個webpy錯誤?Sqlite3/Webpy:「沒有這樣的列」雙左連接
import web
db = web.database(dbn='sqlite', db='data/feed.db')
account = 1
query='''
SELECT a.id, a.url, a.title, a.description, a.account_count, b.id subscribed FROM
(SELECT feed.id, feed.url, feed.title, feed.description, count(account_feed.id) account_count
FROM feed
LEFT OUTER JOIN account_feed
ON feed.id=account_feed.feed_id AND feed.actived=1
GROUP BY feed.id, feed.url, feed.title, feed.description
ORDER BY count(account_feed.id) DESC, feed.id DESC)
a LEFT OUTER JOIN account_feed b ON a.id=b.feed_id AND b.account_id=$account'''
return list(self._db.query(query,vars=locals()))
回溯是在這裏:http://pastebin.com/pUA7zB9H