michaelliao / awesome-python3-webapp

小白的Python入门教程实战篇:网站+iOS App源码→ http://t.cn/R2PDyWN 赞助→ http://t.cn/R5bhVpf
GNU General Public License v3.0
2.37k stars 2.81k forks source link

What is _num_ in sql ? in class Model: findNumber() #1

Closed bestplay closed 7 years ago

bestplay commented 8 years ago

感谢您的 python 教程@michaelliao。 有个疑问:

orm模块中 Model 类中定义了 findNumber() 方法。

里面的的这句 SQL: "select %s num from %s"

其中 num 没有看懂。。。

我是不是错过了啥?

rikouki commented 8 years ago

'select count(account_id) num from account' 'select count(account_id) as num from account' 就是别名

bestplay commented 7 years ago

额。怪我, 平常用 as...