時(shí)間:2024-02-05 12:47作者:下載吧人氣:18
作為一個(gè)表達(dá)式使用的子查詢(xún)返回了多列:
在查詢(xún)中,我們需要以第2條查詢(xún)語(yǔ)句作為第一條查詢(xún)語(yǔ)句的條件,但是第一條根據(jù)這個(gè)條件查詢(xún)出來(lái)是多個(gè)數(shù)據(jù),這時(shí)候又需要保留多個(gè)數(shù)據(jù),運(yùn)用子查詢(xún)就會(huì)報(bào)錯(cuò),
以下就為解決這種多對(duì)多關(guān)系查詢(xún),且沒(méi)有關(guān)聯(lián)關(guān)系的表的解決方案:
select c.rain_value,c.ad_nm from
(
select *, json::json->t2.lon_lat as rain_value from actual_time_model_json t1,
(SELECT DISTINCT lon || ‘_’ || lat as lon_lat,ad_nm from grid_all_points_null)t2 where section=’0′ and t1.filename = ‘Z_NWGD_C_BCCD_20180711022009_P_RFFC_SPCC-ER01_201807110800_02401.GRB2’
)c where c.rain_value is not null
網(wǎng)友評(píng)論