我正在尝试在 SQL Server 中运行查询,其中我选择的列与其分组方式不同。此查询在 SAP 中使用。
问题是,如果我按所有选定的相同列进行分组,则没有任何分组。
这是我的查询(显然不起作用)。
SELECT
T0.[CardCode], T2.[SlpName] as 'Rep',
T0.[CardName] as 'Facility',
T1.[Address] as 'Attention',
T1.[Street] as 'Address 1',
T1.[Block] as 'Address 2', T1.[City] as 'City',
T1.[State] as 'State',
T1.[ZipCode] as 'Zip'
FROM OCRD T0
INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode]
INNER JOIN OSLP T2 ON T2.[SlpCode] = T0.[SlpCode]
WHERE T1.[State] = 'FL'
GROUP BY T0.[CardCode]
对于任何反馈,我们都表示感谢。
谢谢,