Google 查询语言:如何select 最小值?
Google Query Language: How to select the min value?
我正在做一些网络抓取任务,我从网站上获取价格。问题是我 想得到所有选项之间的最小值。 例如:它会寻找一部手机,它有 8GB 并且解锁 B,但我也需要它returns 它找到的所有选项之间的最低价格。 Google查询语言:如何select最小值?
这是我的sheet.This is the google spreadsheet
=QUERY(ImportJSON(C2),"SELECT Col4,Col20 WHERE Col4 CONTAINS '8GB' AND Col4 CONTAINS 'Unlocked B' LIMIT 1 label Col4'',Col20''",1)
如何修改该公式,使其成为 returns 最低价格?这就像一个循环函数,这可能吗?不管它的颜色
例如,我希望函数查找价格,它已经这样做了,但我想获得它能找到的最低价格,而不是它找到并与公式匹配的第一个价格
尝试:
=QUERY(IMPORTJSON(C2),
"select Col4,Col20
where Col4 contains '8GB'
and Col4 contains 'Unlocked B'
order by Col20
limit 1
label Col4'',Col20''", 1)
或:
=QUERY(IMPORTJSON(C2),
"select Col4,min(Col20)
where Col4 contains '8GB'
and Col4 contains 'Unlocked B'
group by Col4
order by min(Col20)
limit 1
label Col4'',min(Col20)''", 1)
我正在做一些网络抓取任务,我从网站上获取价格。问题是我 想得到所有选项之间的最小值。 例如:它会寻找一部手机,它有 8GB 并且解锁 B,但我也需要它returns 它找到的所有选项之间的最低价格。 Google查询语言:如何select最小值?
这是我的sheet.This is the google spreadsheet
=QUERY(ImportJSON(C2),"SELECT Col4,Col20 WHERE Col4 CONTAINS '8GB' AND Col4 CONTAINS 'Unlocked B' LIMIT 1 label Col4'',Col20''",1)
如何修改该公式,使其成为 returns 最低价格?这就像一个循环函数,这可能吗?不管它的颜色
例如,我希望函数查找价格,它已经这样做了,但我想获得它能找到的最低价格,而不是它找到并与公式匹配的第一个价格
尝试:
=QUERY(IMPORTJSON(C2),
"select Col4,Col20
where Col4 contains '8GB'
and Col4 contains 'Unlocked B'
order by Col20
limit 1
label Col4'',Col20''", 1)
或:
=QUERY(IMPORTJSON(C2),
"select Col4,min(Col20)
where Col4 contains '8GB'
and Col4 contains 'Unlocked B'
group by Col4
order by min(Col20)
limit 1
label Col4'',min(Col20)''", 1)