如何为 SQL Server 2008 R2 的选择列表中的几乎所有列重新构建以下 MS Access 查询?MS Access 查询返回 254 条记录,而我在没有 First() 函数的情况下构建的 SQL 查询返回 545 条记录,这显然没有返回所需的结果。任何帮助表示赞赏。提前致谢
SELECT
First(Acct_ID) AS FirstOfAcct_ID,
First(IMDX__ID) AS FirstOfIMDX_ID,
First(Referral_ID) AS FirstOfReferral_ID,
First(FIRSTNAME) AS FirstOfFIRSTNAME
First(LASTNAME) AS FirstOfLASTNAME,
First(ADDRESSLINE1) AS FirstOfADDRESSLINE1,
First(ADDRESSLINE2) AS FirstOfADDRESSLINE2,
First(CITY) AS FirstOfCITY,
First(STATE) AS FirstOfSTATE,
First(ZIPCODE) AS FirstOfZIPCODE,
First(Acct_Office_ID) AS FirstOfAcct_Office_ID,
First(IMDX_Office_ID) AS FirstOfIMDX_Office_ID,
FROM <<TableName>>
GROUP BY ZIPCODE,LASTNAME,FIRSTNAME,Acct_Office_ID,IMDX_Office_ID
HAVING (((First(posdesc)) Is Not Null) AND ((ACTIVE)<>0) AND ((CP_Active)<>0));