Application Development and Automation 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: 
Read only

meaning

Former Member
0 Likes
641

HI,

Please explain me what exactly the follwing select statement doing.....and also can you please tell me the solution to avoid the select *

SELECT COUNT( * )

FROM nast

INTO l_count

WHERE kappl = nast-kappl

AND objky = nast-objky

AND kschl = nast-kschl

AND spras = nast-spras

AND parnr = nast-parnr

AND parvw = nast-parvw.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615

Hi Ginger,

From the select statement you get the total number of records that are present in NAST that satisfy the WHERE condition. Instead of COUNT(*), you can use the system variable sy-dbcnt to determine the number of records that will be read using the select statement.

4 REPLIES 4
Read only

Former Member
0 Likes
615

Hi

COUNT(*) supplies the total number of values (rows in a result table or group)

It counts the number of entries in table NAST based on the condition

Regards

Shiva

Read only

Former Member
0 Likes
615

Hi,

count( * ) returns number of records

in table

COUNT is a set function.

· COUNT(*) supplies the total number of values (rows in a result table or group).

· COUNT(DISTINCT )supplies the number of values that differ from the NULL value (number of values in the argument of the ALL function)

The result has the data type FIXED(10).

Example table: customer

How many customers are there?

SELECT COUNT (*) number FROM customer

Regards

Read only

Former Member
0 Likes
615

Hi,

it will give u the total number o f records in the table NAST which are satisfying the conditions mentioned in the where clause.

rgds,

bharat.

Read only

Former Member
0 Likes
616

Hi Ginger,

From the select statement you get the total number of records that are present in NAST that satisfy the WHERE condition. Instead of COUNT(*), you can use the system variable sy-dbcnt to determine the number of records that will be read using the select statement.