我可以不使用视图直接连接 SELECT 语句吗?
是否可以在不创建视图的情况下执行以下操作?即直接加入这些 SELECT ?
CREATE VIEW temp_first AS SELECT MIN(DATE) AS mindate,id FROM mytable GROUP BY id
#
SELECT *, t.mindate FROM aggregate_analysis a
JOIN temp_first t
ON t.id = a.id
WHERE (.... )
ORDER BY mindate DESC
Is it possible to do the following without a creating a view in between? I.e. by just joining these SELECTs directly?
CREATE VIEW temp_first AS SELECT MIN(DATE) AS mindate,id FROM mytable GROUP BY id
#
SELECT *, t.mindate FROM aggregate_analysis a
JOIN temp_first t
ON t.id = a.id
WHERE (.... )
ORDER BY mindate DESC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够用子查询/子选择替换选择中的视图引用。
查看
类似的东西
You should be able to replace the view refernce in the select with a sub query/sub select.
Have a look at
Something like