› 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
michaelroshen
V2EX  ›  MySQL

嵌套 sql 求助!

  •  
  •   michaelroshen · Jun 16, 2016 · 2470 views
    This topic created in 3772 days ago, the information mentioned may be changed or developed.

    h1. 需求表( A )

    h1. 数据表( B )

    根据表 A 里面的 internalname, worktime 关联 B 表,并随机取出关联后的数据(数量为 A 表中的 hx )

    举例:

    id-- internalname| 3-- abc 5-- abc 6-- abc

    A 表中 abc 对应的 xh 为 3 ,所以随机取出 B 表中的三条记录 A 表中 ccc 对应的 xh 为 0, 所以不取

    请教 sql 如何写?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1407 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 16:55 · PVG 00:55 · LAX 09:55 · JFK 12:55
    ♥ Do have faith in what you're doing.