PROGRESS 数据库条件连接的 SQL 命令
请耐心等待 SQL 新手 - 我正在尝试编写一个带有 PROGRESS 数据库连接的 SQL 命令。然后我想仅从连接中选择第一个匹配的记录。我想使用 LIMIT 但 PROGRESS 不支持。我认为 MIN 或 TOP 也可以工作,但语法有问题。 像这样的东西? -
SELECT table1.field 1, table2.field 2
FROM table2
INNER JOIN table2
ON table1.field3=table2.field3
WHERE table1.field4 in (SELECT min(table1.field4) FROM table1)
但看来我不能在那里使用 MIN ,因为不能在那里进行聚合。 任何帮助都会是巨大的。
Please bear with me new to SQL- I am trying to write an SQL command with a join in a PROGRESS db. I would like to then select only the first matching record from the join. I thought to use LIMIT but PROGRESS does not support that. MIN or TOP would also work I think but having trouble with the syntax.
Something like this?-
SELECT table1.field 1, table2.field 2
FROM table2
INNER JOIN table2
ON table1.field3=table2.field3
WHERE table1.field4 in (SELECT min(table1.field4) FROM table1)
BUt it appears I can't use MIN there as saying can't do an aggregate there.
Any help would be huge.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
try: