‎2008 Feb 19 12:03 PM
hi to all,
i wrote select query for fetching duplicate records,like select distinct *.
so at runtime it fetches all fields in table (FI dbtable).
but i want to fetch only 8 records,for this i am using
select distinct
field1
field2
..... like this ,it wasnt excuted.
how can i avoid this issue.
in program not much logic is there,only fetching the data and summation,n display.....
plz giv me reply asap.
regards
satya
‎2008 Feb 19 12:15 PM
>
> hi to all,
>
> i wrote select query for fetching duplicate records,like select distinct *.
> so at runtime it fetches all fields in table (FI dbtable).
>
> but i want to fetch only 8 records,for this i am using
> select distinct
> field1
> field2
> ..... like this ,it wasnt excuted.
>
> how can i avoid this issue.
> in program not much logic is there,only fetching the data and summation,n display.....
>
> plz giv me reply asap.
>
> regards
> satya
Hi,
write like this
> select field1
> field2
> .......
> from table
> into ( itab-f1,
> itab-f2,
> ........ )
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 19, 2008 5:14 PM
‎2008 Feb 19 12:18 PM
hi,
write this way...
select field1 field2
from zXX
into corresponding fields of itab.
Regards,
Anil.
‎2008 Feb 19 12:23 PM
Hi,
Syntax
SELECT [SINGLE]|[DISTINCT]
| <si> [AS <a i>]... <agg>( [DISTINCT] <s j>) [AS <a j>]...
The selection can be one line, SINGLE, or several lines. You can eliminate duplicate lines using the DISTINCT addition. To select the entire line, use *, otherwise, you can specify individual columns <si>. For individual columns, you can use aggregate functions <agg>, and assign alternative column names <a i>.
Regards,
Bhaskar
‎2008 Feb 19 12:27 PM
Hi,
There are so many ways for improve the performance of your report like as follows
1) The select statement which you are written it should follow the index other wise it will take time to get the data from the database
2) Use the sequence of the fields what you are selecting
3) Use the count procedure when you are getting the more no pf records
many more.......
regards,
Madan.k
‎2008 Feb 20 4:45 AM
Hi,
SELECT field1
field2
field3
field4
INTO CORRESPONDING FIELDS OF itab
WHERE <conditions>
this will solve your porblem.
regards,
teja
‎2008 Feb 20 5:15 AM
WRITE THE QUERY AS
SELECT F1 F2 F3
FROM TABLE_NAME
INTO TABLE ITAB
WHERE CONDITION.
DO NOT USE DISTINCT. IT LOADS ON DATABASE.
TO AVOID DUPLICATES, SORT THE itab AND THEN USE
DELETE ADJACENT DUPLICATES FROM ITAB
Narendra