V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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
lusin
V2EX  ›  MySQL

请问mysql如何查询id能被3整除的数据

  •  
  •   lusin · Mar 7, 2013 · 5297 views
    This topic created in 4798 days ago, the information mentioned may be changed or developed.
    3 replies    1970-01-01 08:00:00 +08:00
    ljbha007
        1
    ljbha007  
       Mar 7, 2013
    select * from my_table where id % 3 = 0
    cjou
        2
    cjou  
       Mar 7, 2013
    SELECT id From `table` WHERE id mod 3=0;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3910 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:09 · PVG 08:09 · LAX 17:09 · JFK 20:09
    ♥ Do have faith in what you're doing.