Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select Car.*
- from Car
- where CarN not in (
- select CarN
- from [Contract]
- where year([GetDate]) = year(getdate())
- );
- select distinct
- Offcode,
- City,
- Addr
- from
- [Office] as O
- inner join [Contract] as C on O.RecN = C.RetRecN
- where
- CarN not in (
- select CarN
- from [Contract]
- where GetRecN = C.GetRecN
- )
- select
- Offcode,
- RegNum
- from
- [Office]
- cross join [Car]
- except (
- select
- Offcode,
- RegNum
- from
- [Office] as O
- inner join [Contract] as C on O.RecN = C.GetRecN
- inner join [Car] as car on car.CarN = c.CarN
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement