Viewing 15 posts - 1,951 through 1,965 (of 10,144 total)
mcoleman15902 (11/2/2015)
Dynamic query may take too much time given my skill set. Could you provide one of the queries and I can work from that method?Thanks, Sir.
MC
Actually, I was...
November 2, 2015 at 9:56 am
If the column count can be different, then they are four different queries - or dynamic SQL.
November 2, 2015 at 8:32 am
mcoleman15902 (11/2/2015)
November 2, 2015 at 8:12 am
Watch out for NULLs:
SELECT A,B,C,D
FROM (VALUES ('Y','Y','Y','Y'),('Y','N','Y','Y'),('Y',NULL,'Y','Y')) d (A,B,C,D)
WHERE 'Y' IN (A,B,C,D)
SELECT A,B,C,D
FROM (VALUES ('Y','Y','Y','Y'),('Y','N','Y','Y'),('Y',NULL,'Y','Y')) d (A,B,C,D)
WHERE 'N' NOT IN (A,B,C,D)
SELECT A,B,C,D
FROM (VALUES ('Y','Y','Y','Y'),('Y','N','Y','Y'),('Y',NULL,'Y','Y')) d (A,B,C,D)
WHERE 'N' NOT IN (ISNULL(A,'Y'),ISNULL(B,'Y'),ISNULL(C,'Y'),ISNULL(D,'Y'))
SELECT...
November 2, 2015 at 8:00 am
mcoleman15902 (11/2/2015)
WHERE V.S_CL_SM_BUS_CD = 'F'
AND 'Y' IN (V.CL_VET_FL, V.CL_SD_VET_FL, V.CL_ANC_IT_FL, V.CL_DISADV_FL,...
November 2, 2015 at 7:46 am
ben.brugman (11/2/2015)
ChrisM@Work (11/2/2015)
Can you share a couple of your queries (obfuscated, of course)?
Sorry at the moment I do not see a feasible way to do this within a limited amount...
November 2, 2015 at 7:17 am
SELECT V.S_CL_SM_BUS_CD
,V.VEND_NAME_EXT
,LNHS.CST_AMT
,VCHR.VEND_ID
,V.CL_VET_FL
,V.CL_SD_VET_FL
,V.CL_ANC_IT_FL
,V.CL_DISADV_FL
,V.CL_WOM_OWN_FL
,V.CL_LAB_SRPL_FL
,V.CL_HIST_BL_CLG_FL
,V.CL_ANC_IT_FL
,VCHR.VCHR_KEY
FROM WEBAPP_CP.DELTEK.V_VEND v
LEFT JOIN WEBAPP_CP.DELTEK.V_VCHR_HDR_HS VCHR
ON v.VEND_ID = VCHR.VEND_ID
INNER JOIN WEBAPP_CP.DELTEK.VCHR_LN_ACCT_HS LNHS
ON VCHR.VCHR_KEY = LNHS.VCHR_KEY
WHERE V.S_CL_SM_BUS_CD = 'F'
AND 'Y' IN (V.CL_VET_FL, V.CL_SD_VET_FL, V.CL_ANC_IT_FL, V.CL_DISADV_FL, V.CL_WOM_OWN_FL, V.CL_LAB_SRPL_FL, V.CL_HIST_BL_CLG_FL,...
November 2, 2015 at 6:46 am
muralikrishna2489 (11/2/2015)
Thanks very much for the advise !
I have one doubt, please clarify on the below quotes,
You might have to adjust the column list in the PARTITION BY clause
You...
November 2, 2015 at 5:54 am
chris92mars (11/2/2015)
November 2, 2015 at 5:17 am
A query like this
SELECT
rn = ROW_NUMBER() OVER(PARTITION BY AccountNumber, HexaNumber, HexaEffDate, HexaId, TransactionEffDate, TransactionExpDate, HexaCode, CompanyCode, CategoryCode, AdjustmentUserId
ORDER BY (SELECT NULL)),
*
FROM CodeChanges
should identify your dupes. You might have...
November 2, 2015 at 5:04 am
ben.brugman (11/2/2015)
The actual number of columns in the 'covering index' was 10. And yes they are all used in the...
November 2, 2015 at 4:48 am
ben.brugman (11/2/2015)
GilaMonster (11/1/2015)
Columns included are in the leaf level only, not the key, so the index is smaller than if they were in the key.
They also don't count towards the...
November 2, 2015 at 3:46 am
Jeff Moden (10/31/2015)
TomThomson (10/31/2015)
ChrisM@Work (10/29/2015)
Ed Wagner (10/29/2015)
yb751 (10/29/2015)
I was thinking about unleashing it...
November 2, 2015 at 2:07 am
Mile Higher Than Sea Level (10/30/2015)
A simple Select query against Oracle...
October 30, 2015 at 10:24 am
mw112009 (10/30/2015)
Select A.* from A inner join B on ( A.ID= B.ID )
I know there is some key word that you use to force SQL server to generate a new...
October 30, 2015 at 10:06 am
Viewing 15 posts - 1,951 through 1,965 (of 10,144 total)