如何消除计数所有内容的行〔SQL中的COUNT函数〕



我运行了一段代码,需要在其中查看表中的前10个结果。不幸的是,我还有一排,这是我所期待的。

SELECT 
usertype,
CONCAT(start_station_name," to ", end_station_name) AS route,
COUNT(*) AS num_trips,
ROUND(AVG(CAST(tripduration AS int64)/60),2) AS duration
FROM 
`bigquery-public-data.new_york_citibike.citibike_trips`
GROUP BY
start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
LIMIT 10

我的结果如下:【查询后结果】[1][1] :https://i.stack.imgur.com/KCu7W.png

有什么方法可以从查询中删除第1行吗?

提前感谢您的帮助!

试试这个:

SELECT 
usertype,
CONCAT(start_station_name," to ", end_station_name) AS route,
COUNT(*) AS num_trips,
ROUND(AVG(CAST(tripduration AS int64)/60),2) AS duration
FROM 
`bigquery-public-data.new_york_citibike.citibike_trips`
where start_station_name is not null
GROUP BY
start_station_name, end_station_name, usertype
ORDER BY
num_trips DESC
LIMIT 10

相关内容

  • 没有找到相关文章

最新更新