括号中的SQL是子查询吗?

问题描述 投票:0回答:1

我使用的 GIS 软件有一个名为“文件地理数据库”的专有数据库。 文档说:

ArcGIS 中使用的查询表达式的 SQL 参考

子查询

文件地理数据库中的子查询支持仅限于以下内容:

    带有比较运算符的标量子查询。标量子查询返回 单个值,例如:
  • GDP2006 > (SELECT MAX(GDP2005) FROM countries)

    对于文件地理数据库,集合函数 AVG、COUNT、MIN、
    MAX 和 SUM 只能在标量子查询中使用。

  • EXISTS 谓词, 例如:
  • EXISTS (SELECT * FROM indep_countries WHERE COUNTRY_NAME = 'Mexico')

    
    

我有一个查询,用于在文件地理数据库中创建数据库视图。视图运行没有错误。

--species_records_latest_vw --For each species group, select the row that has the latest date. --Does not break ties if there are multiple rows per species with the same date. select * from species_records inner join (select t_species, max(t_date) as t_date from species_records group by t_species) l on species_records.t_species = l.t_species and species_records.t_date = l.t_date

Excel 数据示例:
https://community.esri.com/ccqpr47374/attachments/ccqpr47374/arcgis-pro-ideas/27986/1/species_records.xlsx


问题:

括号中的 SQL 是标量子查询吗?如果是,那么我想知道文档是否不正确。

sql subquery arcgis terminology scalar-subquery
1个回答
4
投票
派生表

© www.soinside.com 2019 - 2024. All rights reserved.