SELECT stable.scate, stable.stname, s2table.aTime, atable.stname, a2table.aTime, available_reservation_seat AS ars, if( stable.scate = 'KTX', 7200 * count( 2table.no ) +8400, if( stable.scate = '새마을', 3136 * count( 2table.no ) +4800, 950 * count( 2table.no ) +2600 ) ) * rtable.ea as fee
FROM 1table AS stable, 1table AS atable, 2table AS s2table, 2table AS a2table, 2table, 3table, rtable
WHERE stable.stname = rtable.sStion
AND atable.stname = rtable.aStion
AND stable.scate = atable.scate
AND stable.no = s2table.t1no
AND atable.no = a2table.t1no
AND s2table.tno = a2table.tno
AND s2table.aTime >= rtable.Time
AND 2table.no > s2table.no
AND 2table.no < a2table.no
AND s2table.no = 3table.t2no
AND 3table.dynamic_date > ( rtable.date - curdate( ) )
Group by s2table.no
님 전자공학과니까 하드웨어의 성능을 높혀서 극뽁하세여
프로시저로 만들어서 눈에 안보이게 숨기면 데헷!
미친 크로스 조인을 왜 함 ㅡㅡ
FROM a, b, c가 크로스 조인인 건 암? 카티션 곱인 거?
아니 진짜 FROM 1table AS stable, 1table AS atable, 2table AS s2table, 2table AS a2table, 2table, 3table, rtable 이거 보고 할말을 상실함 ㅋㅋㅋ
곱이 몇 개여. 항이 7개네? N^7 잼 ㅋㅋㅋ
와 이새낀 뭐지