我开始学习数据库mysql 我很困惑如何在一页中管理所有表格
我已经尝试过数据表,但仍然不喜欢我想要的 我不知道在谷歌搜索的关键字
所有表总是有“visitor_id”
示例:
列出visitor_id
visitor_id | visitor_ip | visitor_country |
---|---|---|
1 | 192.168.1.122 | SG |
2 | 192.168.1.11 | 英国 |
3 | 192.168.1.9 | 中国 |
4 | 192.168.1.89 | 英国 |
带有file_id 和visitor_id 的文件列表
file_path 为空,visitor_id 有 2 个 file_path
file_id | visitor_id | 文件路径 |
---|---|---|
1 | 1 | /hello.img |
2 | 2 | /p.img |
3 | 3 | |
4 | 4 | /hii.img |
5 | 2 | /hello.img |
我保存在统计表中
查看stats_file,值为2,因为visitor_id 2有两个文件
如果没有文件,stats_file为0
stats_id | visitor_id | stats_file |
---|---|---|
1 | 1 | 1 |
2 | 2 | 2 |
3 | 3 | 0 |
4 | 4 | 1 |
所以,我想要这样的输出
visitor_id 3 被隐藏,因为没有文件