2006 Aug 22 7:02 AM
Hi All,
This is a repost but this time Ill be specific.
How do I select from a table into a hashed table faster without using "select distinct"? my primary concern is the speed of the select statement, and im afraid I cannot get rid of the hashed table destination.
Thanks,
Kenny
2006 Aug 22 7:06 AM
[code]select field1 field2 into table itab
from dbtab where cond.
Hashed tables don't take any duplicate record,
hence, we have to specify all the KEY FIELDS,when declaring the table.
HI Kenny,
HASHED TABLE:
There is no default setting for hashed tables. However, you must define a UNIQUE key. The NON-UNIQUE addition is not permitted.
You cannot avoid this statement. May be the alternative is You have to use SORTED table with NON-UNIQUE option and then apply DELETE ADJACENT DUPLICATES, in this way you can have unique values for your itab.
Regards,
Raghav
2006 Aug 22 7:06 AM
[code]select field1 field2 into table itab
from dbtab where cond.
Hashed tables don't take any duplicate record,
hence, we have to specify all the KEY FIELDS,when declaring the table.
2006 Aug 22 7:13 AM
Thanks Kishan,
Problem is Im only after one field from the dbtab. And this is not a unique key, thats why Im using select distinct now. Therefore, I am limited to it for selecting Unique rows. Please help.
Thanks.
Kenny
2006 Aug 22 8:34 AM
HI Kenny,
HASHED TABLE:
There is no default setting for hashed tables. However, you must define a UNIQUE key. The NON-UNIQUE addition is not permitted.
You cannot avoid this statement. May be the alternative is You have to use SORTED table with NON-UNIQUE option and then apply DELETE ADJACENT DUPLICATES, in this way you can have unique values for your itab.
Regards,
Raghav
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |