以前学SQL的时候,只会简单的增删查改,然后什么课设,毕设都是增删查改,想想好智障~ 

1.从表中选取出不同的值

select distinct company from order;

2.返回列的最大值

select MAX(column_name) from table_name;

3.返回某列信息的不同值的最大值

select *
from (
select food,max(prince) prince from order
group by food 
)order;

4.周六日的平均气温

select AVG(meantempi)
from(
select * from weather_date where cast(strftime ('%w',date)
as integer) IN (6,0)
)weather_date;

5.找出平均气温大于55是雨天的平均最低气温

select AVG(mintempi)
from(
select * from weather_data 
where mintempi > 55 and rain = 1
)weather_data;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-12-01
  • 2021-07-03
  • 2021-11-16
  • 2021-08-14
猜你喜欢
  • 2021-11-28
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案