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
 What does this index mean

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.

Thanks

select
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_Rx

from
mwad_wokdb.data1_&label data
left outer join mwad_wokdb.pairs_&label b on data.gcn_nbr = b.gcn_nbr
group 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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-03-25 : 14:19:44
Looks like Teradata.

It's definitely not MS SQL Server
Msg 1018, Level 15, State 1, Line 6
Incorrect 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 16
Incorrect 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 Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -