mysql - 我想了解这个查询是什么意思?

标签 mysql join

select user.*,
store.storeId,store.storeName from 
user JOIN store ON user.storeId=store.storeId 
where email=? and password=?

这是我在加入表时想到的 mysql 查询,但我无法获取我的查询正在做什么,我无法获取它。

最佳答案

从用户表中选择所有内容。

select user.*,

从商店表中选择 storeId 和 storeName。

store.storeId,store.storeName

将两个表连接在一起,其中用户表中的 storeId = 到商店表中的 storeId,其中电子邮件和通行证 = 他们在输入中键入的内容

from 
user JOIN store ON user.storeId=store.storeId 
where email=? and password=?

关于mysql - 我想了解这个查询是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49568370/

相关文章:

mysql - 什么更好,许多重复的行或增加表格?

连接数据的 MySQL 条件

sql - 如何改进 moSTLy "degenerate"内部联接?

MySQL 连接返回从另一个表链接的不同 ID

mysql - Where 子句在 Laravel 中不返回正确的数据

php - WAMP 服务器不允许访问 PHPMyAdmin

php - 如何在foreach循环中查询preg_match_all结果?

c# - C# 的 mysql 存储过程出错

mysql - 同一查询中不同列的多个求和

sql - SQLite 自连接 ID 中的错误?