SELECT * , if( scate = 'KTX', 7200 * ( count( 3table.no ) -1 ) +8400, if( scate = '새마을', 3136 * ( count( 3table.no ) -1 ) +4800, 950 * ( count( 3table.no ) -1 ) +2600 ) ) AS fee, if( scate = 'KTX', 7200 * ( count( 3table.no ) -1 ) +8400, if( scate = '새마을', 3136 * ( count( 3table.no ) -1 ) +4800, 950 * ( count( 3table.no ) -1 ) +2600 ) ) * ea AS total_fee
FROM 3table
LEFT JOIN 2table AS 2table1 ON ( 3table.t2no = 2table1.no )
LEFT JOIN 1table AS 1table1 ON ( 2table1.t1no = 1table1.no ) , rtable
WHERE (
rtable.sStion = 1table1.stname
OR rtable.aStion = 1table1.stname
)OR rtable.aStion = 1table1.stname
AND rtable.time <= 2table1.atime
GROUP BY 2table1.aTime
ㅋㅋㅋ
컴퓨터파괴자
여태까지 걍 제대로 안봤는데, 지금 보니 기차 예매 시뮬레이션 만들고 있음?