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.
| Author |
Topic |
|
what1980
Starting Member
2 Posts |
Posted - 2010-03-25 : 13:08:33
|
| Hello,I was wondering if anyone can tell me what this statement is really doing. This code was handed down to me and I am question exactly what the function of the index is. Any help would be great.Thanksselect data.GCN_NBR, b.and_nme, b.conversion_rate, data.INFERRED_MET_CDE, sum(index('R',ml_r_cde)*Rx) as R_Rx, sum(index('R',ml_rl_cde)*index('B',INFERRED_MET_CDE)*Rx) as R_G_Eq_Rx, sum(index('R',ml_rl_cde)*index('A',INFERRED_MET_CDE)*Rx*coalesce(b.conversion_rate,0)) as R_G_Alt_Rx, sum(index('M',ml_rl_cde)*Rx) as M_Rx, sum(index('M',ml_rl_cde)*index('B',INFERRED_MET_CDE)*Rx) as M_G_Eq_Rx, sum(index('M',ml_rl_cde)*index('A',INFERRED_MET_CDE)*Rx*coalesce(b.conversion_rate,0)) as M_G_Alt_Rxfrom mwad_wokdb.data1_&label data left outer join mwad_wokdb.pairs_&label b on data.gcn_nbr = b.gcn_nbrgroup by 1,2,3,4) with data primary index(GCN_NBR) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-25 : 13:11:26
|
| is this ms sql server?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-03-25 : 14:19:44
|
| Looks like Teradata.It's definitely not MS SQL ServerMsg 1018, Level 15, State 1, Line 6Incorrect syntax near 'index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.Msg 319, Level 15, State 1, Line 16Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|
|
|