V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
clino
V2EX  ›  MySQL

菜鸟问题:能做到某个字段的内容是另一个表的查询结果的记录数吗?

  •  
  •   clino ·
    zhangchunlin · 2011-12-15 15:33:10 +08:00 · 4012 次点击
    这是一个创建于 4507 天前的主题,其中的信息可能已经有所发展或是发生改变。
    例如我想做到一个表的某个字段的内容是另一个表的某个字段为True的查询结果的记录数,能做到吗?
    因为不想显示的时候每个都去查询.
    数据库方面目前完全是菜鸟阿.
    谢谢!
    3 条回复    1970-01-01 08:00:00 +08:00
    chloerei
        1
    chloerei  
       2011-12-15 15:35:43 +08:00
    视图?
    clino
        2
    clino  
    OP
       2011-12-15 16:01:08 +08:00
    @chloerei 看起来应该是这个,先研究一下
    clino
        3
    clino  
    OP
       2011-12-15 16:11:43 +08:00
    哦,其实我现在使用 sqlachemy 在操作数据库,orm这种东东似乎不支持视图,那还是用笨办法好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5986 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:14 · PVG 14:14 · LAX 23:14 · JFK 02:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.