以下の問題の解決に誰かが私を手伝ってくれる?
create table [order1] (order_id int, CartTransaction_Id int, Status_Id int);
insert into [order1] values
(357488,87214,1),
(357489,87214,8),
(357490,87214,1),
(357491,87214,1),
(343980,87216,1),
(357483,87216,1);
create table [Status1] (Type VARCHAR(100), Status_Id int);
insert into [Status1] values
('New','1'),
('Awaiting Approval','8'),
('New','1'),
('New','1'),
('New','1'),
('New','1');
select
A.Order_Id, A.CartTransaction_Id, A.Status_Id, B.Type, B.Status_Id
FROM order1 A
JOIN dbo.Status1 B ON dbo.A.Status_Id = dbo.B.Status_Id
--AND B.Type = 'New'
order by A.CartTransaction_Id
以下は上記のクエリから得た出力です。

以下は期待された結果でした

CartTransaction_Idのグループ内のすべてのorder_idのステータスタイプが
'New'である場合にのみデータを入力する必要があります
発注から、order_id
status_typeの1つが承認待ちになっていたので、CartTransaction_Id(87214)を除外する必要があります。