Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 2 new items in Query for me.

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2014-02-05 : 18:21:49
in this query, I am not certain what [BATCH] AS column1

"SELECT distinct ID_KEY, [BATCH] AS column1, [IMPORTDATE],
and [STAT] STATUS

[DATEBILLED], [STAT] STATUS, [LASTTASKDATE],SEQNO,B.[SUBST_INSTRUCTIONS] FROM [PBM].[T_CHARGES] A LEFT OUTER JOIN [OGEN].[NDC_M_FORMULARY] B ON A.[NDC] = B.[NDC] Where [STAT] not in (3, 4) AND [TIER] <> 'T1' AND FACILITYNPI IN (select f.FACILITY_NPI from PBM.FACILITY f INNER JOIN PBM.USER_FACILITY uf ON f.FACILITY_ID = uf.FACILITY_ID Where uf.USER_ID=" + userID + ")";

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-02-05 : 19:29:09
"column1" is an "Alias" name for that column. The "AS" is just an optional keyword that says to rename the column.

===============================================================================
There are two kinds of light -- the glow that illuminates, and the glare that obscures. -James Thurber (1894-1961)
Go to Top of Page
   

- Advertisement -