By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE T
([Client_ID] int, [Client_Name] varchar(10), [Order_Date] datetime, [Revenue] int)
;
INSERT INTO T
([Client_ID], [Client_Name], [Order_Date], [Revenue])
VALUES
(214, 'ssms', '2017-02-04 00:00:00', 10000),
(344, 'oracle', '2017-02-14 00:00:00', 9000),
(754, 'postgresql', '2017-07-17 00:00:00', 15000),
(154, 'toad', '2017-09-27 00:00:00', 14852),
(854, 'teradata', '2017-12-14 00:00:00', 54111),
(654, 'sybase', '2017-10-25 00:00:00', 85477),
(214, 'ssms', '2018-03-25 00:00:00', 25000),
(854, 'teradata', '2018-05-14 00:00:00', 35000),
(654, 'sybase', '2018-10-24 00:00:00', 45000)
;
9 rows affected
select client_id, client_name
from T tt
where year(order_date) = 2017
and not exists(select 1 from t where client_id = tt.client_id and year(order_date) = 2018)
client_id | client_name |
---|---|
344 | oracle |
754 | postgresql |
154 | toad |