1. 程式人生 > >SQLZOO(self join)writeup未完

SQLZOO(self join)writeup未完

1

select count(id) from stops

2

select id from stops where name='Craiglockhart'

3.

select id,name from stops join route on stops.id=route.stop
where route.num=4 and route.company='LRT'

4.

SELECT company, num, COUNT(*)
FROM route WHERE stop=149 or stop=53
GROUP BY company, num
having count(*)
=2