17 lines
564 B
Transact-SQL
17 lines
564 B
Transact-SQL
USE
|
|
Metro
|
|
GO
|
|
|
|
CREATE VIEW v_raspisanie
|
|
AS
|
|
SELECT start_vremya AS 'Îòïðàâëåíèå', s1.name AS 'Ñî ñòàíöèè', finish_vremya AS 'Ïðèáûòèå', s2.name AS 'Íà ñòàíöèþ', vetka AS 'Âåòêà'
|
|
FROM (raspisanie inner join stanciya s1 on start_kod=kod) inner join stanciya s2 on finish_kod=s2.kod
|
|
GO
|
|
|
|
|
|
CREATE VIEW v_remont
|
|
AS
|
|
SELECT typik AS 'Òóïèê', serial AS 'Ñîñòàâ', name AS 'Íåèñïðàâíîñòü', start AS 'Âðåìÿ íà÷àëà', DATEADD(DAY,srok_dos_det+vremya_remonta,start) AS 'Ïðåäïîëîæèòåëüíîå îêîí÷àíèå'
|
|
FROM (remont inner join spravka on remont.kod=spravka.kod)
|
|
GO
|