postgresql - postgresql中的内部连接
问题描述
我正在执行下面的查询,查询抛出一个错误(错误:“内部”或附近的语法错误)
如果我缺少任何东西,有人可以帮助我吗
SELECT a.*
FROM table1 a where a.snapshot_date='2019-07-31'
inner join table2 b
ON a.snapshot_date=b.snapshot_date
解决方案
你的where
条款有问题:
SELECT a.*
FROM table1 a
inner join table2 b
ON a.snapshot_date=b.snapshot_date
where a.snapshot_date='2019-07-31'
编辑:如果您想从table2
您那里获得信息,还应该将其添加到,select
而不仅仅是来自table1
:
SELECT *
FROM table1 a
inner join table2 b
ON a.snapshot_date=b.snapshot_date
where a.snapshot_date='2019-07-31'
推荐阅读
- docker - 有没有办法从 6.0 之前的版本中获取清漆图像
- swift - 如何让用户保持登录 SwiftUI?
- python - 在 python 中跨多个数据帧使用分类编码
- c - 管道重定向问题,丢失数据
- python - 除非数组中的数字与某个值匹配,否则如何将数字添加到数组中
- mysql - 友好的 url 更改后的 301 重定向
- vue.js - Vue,js 与 Supabase 一起使用 - 使用 Oauth 登录后无法更新登录按钮
- c# - 从 Jquery 到 C# Web API 传递和处理英国日期格式
- tensorflow - 如何将 Tensorflow Recommenders 的检索任务与 Keras 数据生成器一起使用
- twitter-bootstrap - 使用自定义引导程序时,@imports 的 @use 等效项是什么?