Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Meaning of this SQL statement

Former Member
0 Kudos

SELECT "RCLNT" AS c,"GL_SIRID" AS c,"RLDNR" AS c,"RRCTY" AS c,"RVERS" AS c,"RYEAR" AS c,"RTCUR" AS c,"RUNIT" AS c,"DR

CRK" AS c,"POPER" AS c,"DOCCT" AS c,"DOCNR" AS c,"DOCLN" AS c,"RBUKRS" AS c,"RPRCTR" AS c,"RHOART" AS c,"RFAREA"

AS c,"KOKRS" AS c,"RACCT" AS c,"HRKFT" AS c,"RASSC" AS c,"EPRCTR" AS c,"ACTIV" AS c,"AFABE" AS c,"OCLNT" AS c,"

SBUKRS" AS c,"SPRCTR" AS c,"SHOART" AS c,"SFAREA" AS c,"TSL" AS c,"HSL" AS c,"KSL" AS c,"MSL" AS c,"CPUDT" AS c,

"CPUTM" AS c,"USNAM" AS c,"SGTXT" AS c,"AUTOM" AS c,"DOCTY" AS c,"BLDAT" AS c,"BUDAT" AS c,"WSDAT" AS c,"REFDOCN

R" AS c,"REFRYEAR" AS c,"REFDOCLN" AS c,"REFDOCCT" AS c,"REFACTIV" AS c,"AWTYP" AS c,"AWORG" AS c,"WERKS" AS c,"

GSBER" AS c,"KOSTL" AS c,"LSTAR" AS c,"AUFNR" AS c,"AUFPL" AS c,"ANLN1" AS c,"ANLN2" AS c,"MATNR" AS c,"BWKEY" A

S c,"BWTAR" AS c,"ANBWA" AS c,"KUNNR" AS c,"LIFNR" AS c,"RMVCT" AS c,"EBELN" AS c,"EBELP" AS c,"KSTRG" AS c,"ERK

RS" AS c,"PAOBJNR" AS c,"PASUBNR" AS c,"PS_PSP_PNR" AS c,"KDAUF" AS c,"KDPOS" AS c,"FKART" AS c,"VKORG" AS c,"VT

WEG" AS c,"AUBEL" AS c,"AUPOS" AS c,"SPART" AS c,"VBELN" AS c,"POSNR" AS c,"VKGRP" AS c,"VKBUR" AS c,"VBUND" AS

c,"LOGSYS" AS c,"ALEBN" AS c,"AWSYS" AS c,"VERSA" AS c,"STFLG" AS c,"STOKZ" AS c,"STAGR" AS c,"GRTYP" AS c,"REP_

MATNR" AS c,"CO_PRZNR" AS c,"IMKEY" AS c,"DABRZ" AS c,"VALUT" AS c,"RSCOPE" AS c,"AWREF_REV" AS c,"AWORG_REV" AS

c,"BWART" AS c,"BLART" AS c FROM "GLPCA" WHERE "RCLNT" = '007' AND "RLDNR" = '8A' AND "RYEAR" = '2008' AND

"DOCCT" = 'L' AND "DOCNR" = '0111577117' /* /1BCDWB/DBGLPCA 20 */

SELECT

Nested Loops(Inner Join, OUTER REFE GLPCA.RCLNT , CRD.dbo.GLPCA.GL_SIRID ) OPTIMIZED)

log.op: Inner Join phys.op: Nested Loops

Index Seek( GLPCA.GLPCA~2 ), SEEK:( CRD.dbo.GLPCA.DOCNR ='0111577117' AND CRD.dbo.GLPCA.RYEAR ='2008' AND

CRD.dbo.GLPCA.DOCCT ='L'), WHERE:( CRD.dbo.GLPCA.RCLNT ='007' AND CRD.dbo.GLPCA.RLDN

log.op: Index Seek phys.op: Index Seek

Clustered Index Seek( GLPCA.GLPCA~0 ), SEEK:( CRD.dbo.GLPCA.RCLNT = CRD.dbo.GLPCA.RCLNT AND CRD.dbo.GLPCA.

GL_SIRID = CRD.dbo.GLPCA.GL_SIRID ) LOOKUP ORDERED FORWARD)

log.op: Clustered Index Seek phys.op: Clustered Index Seek

4 REPLIES 4

Former Member
0 Kudos

Hi,

what is the problem?

First of all remove all the " " (Double course) and comma ten check it and let us know.

Regards,

Anirban

0 Kudos

SELECT

Nested Loops(Inner Join, OUTER REFE GLPCA.RCLNT , CRD.dbo.GLPCA.GL_SIRID ) OPTIMIZED)

log.op: Inner Join phys.op: Nested Loops

Index Seek( GLPCA.GLPCA~2 ), SEEK:( CRD.dbo.GLPCA.DOCNR ='0111577117' AND CRD.dbo.GLPCA.RYEAR ='2008' AND

CRD.dbo.GLPCA.DOCCT ='L'), WHERE:( CRD.dbo.GLPCA.RCLNT ='007' AND CRD.dbo.GLPCA.RLDN

log.op: Index Seek phys.op: Index Seek

Clustered Index Seek( GLPCA.GLPCA~0 ), SEEK:( CRD.dbo.GLPCA.RCLNT = CRD.dbo.GLPCA.RCLNT AND CRD.dbo.GLPCA.

GL_SIRID = CRD.dbo.GLPCA.GL_SIRID ) LOOKUP ORDERED FORWARD)

log.op: Clustered Index Seek phys.op: Clustered Index Seek

is Index 2 being preferred ?

0 Kudos

Hi sugopa,

Plz tel me in detail wheather it is syntax or a technical specification . Becuse INDEX , Loop are not used in SQL.

Anirban

0 Kudos

Index 2 seems to be preferrend.

In SE11: Try to have the same order of attributes (fields) in one of your indexes as in your selection (where clause). Then the DB optimizer will find the right index automatically.

Best regards,

Torsten