SQL会先执行from语句,然后where,然后是select

SELECT DISTINCT t1.`店铺链接`, t1.`店铺名称`, t1.`平台`
FROM sales AS t1 INNER JOIN shopinfo AS t2 ON t1.`店铺链接` = t2.`店铺链接`
WHERE t2.`省` = "河南";

没问题

 

下边的会报错,sales.`店铺链接` is not in list 之类的错误

SELECT DISTINCT  sales.`店铺链接`, sales.`店铺名称`, sales.`平台`
FROM sales AS t1 INNER JOIN shopinfo AS t2 ON t1.`店铺链接` = t2.`店铺链接`
WHERE t2.`省` = "河南";

SQL会先执行from语句,然后where,然后是select

上一篇:用友U8开发-库存管理收发存汇总表SQL


下一篇:MySQL函数