-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGROUP BY.sql
More file actions
22 lines (15 loc) · 764 Bytes
/
GROUP BY.sql
File metadata and controls
22 lines (15 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
select * from film;
select rental_rate, max(length) from film -- biz buraya sadece grup by yaptığımız sütünü yazabiliriz select'ten sonra başka sütün yazarsak hata verir.
group by rental_rate; -- group by ifadesinden rental_rate olduğundan selectten sonra rental_rate sütünunu yazabilirim.
select rental_rate, count(*) from film
group by rental_rate;
select rating, count(*) from film
group by rating;
select replacement_cost, min(length) from film
group by replacement_cost;
select replacement_cost,rental_rate, min(length) from film
group by replacement_cost, rental_rate
order by replacement_cost;
select replacement_cost,rental_rate, min(length) from film
group by replacement_cost, rental_rate
order by replacement_cost, rental_rate desc;