Bogeybetsy
325 pts. | Aug 5 2009 6:55AM GMT
Thanks Carlos, it did. The records were in reverse order though. Anyway, I can reverse that in my program.
I already had that in mind but I didn’t test it until you confirmed what was on my mind. The phone number is composed of two columns, the exchange and the line #. And the address is also included in the key, which is broken down into state, city, subdivision, st. name, st. direction, st. subtitile, st. number, st. subdescription, and area sequence number. Whew! I guess I would have to apply the Desc keyword to all these fields.
To make it faster, maybe I can use a view with the ORDER BY clause already in place. After all, views are persistent. And the company doesn’t care about memory as long as the query runs in a blink of an eye. What can you suggest?
Thanks to everyone who answered!
Allan
Carlosdl
29845 pts. | Aug 5 2009 8:20AM GMT
You should be able to get the records in the correct order this way:
select * from (Select phone# from pltlcd where phone# < 985143525 order by phone# desc fetch first 20 records only) order by phone#
As for the use of a view, I don’t really know how that RDBMS manages views, so I’m afraid I can’t advise on that.
Cheers,
Bogeybetsy
325 pts. | Aug 5 2009 10:45AM GMT
Hey Carlos,
Thanks again for the tip!
As for the view, it didn’t work out. Turns out you cannot use the ORDER BY clause with a VIEW.
Cheers!
Allan






