《Mysql学习mysql统计多表交叉组合总数实例》要点:
本文介绍了Mysql学习mysql统计多表交叉组合总数实例,希望对您有用。如果有疑问,可以联系我们。
MYSQL实例例子,mysql如何统计多表交叉组合总数.
MYSQL实例>mysql -h localhost -u root -p
MYSQL实例mysql> use world;
Database changed
mysql> show tables;
+-----------------+
| Tables_in_world |
+-----------------+
| city |
| country |
| countrylanguage |
+-----------------+
3 rows in set (0.00 sec)
MYSQL实例mysql> select count(*) from city;
+----------+
| count(*) |
+----------+
| 4079 |
+----------+
1 row in set (0.00 sec)
MYSQL实例mysql> select count(*) from country;
+----------+
| count(*) |
+----------+
| 239 |
+----------+
1 row in set (0.00 sec)
MYSQL实例mysql> select 4079*239
-> ;
+----------+
| 4079*239 |
+----------+
| 974881 |
+----------+
1 row in set (0.00 sec)
MYSQL实例这里就是计算交叉组合数量,因为他们之间一个相同的关联字段
MYSQL实例实际上mysql所做的操作就是把你所查询表的数量相乘得到的结果!
转载请注明本页网址:
http://www.vephp.com/jiaocheng/6183.html