Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
It it possible to know the row number?
Daniel Serodio
2006-10-26 13:40:21
As far as I know, rows are always added to the end of a DBF file. So, to get the most recent record, I could look for the record with the greatest row number.

Is there some way to know the row number? I'd like to "ORDER BY rownum DESC", does HXTT DBF driver provide this feature?

Thanks,
Daniel Serodio
Re:It it possible to know the row number?
HXTT Support
2006-10-26 18:01:53
>Is there some way to know the row number? I'd like to "ORDER BY rownum DESC", does HXTT DBF driver provide this feature?
Yeah. If your table hasn't deleted row, you can use:
select * from youtable where recno()=reccount();
or
select * from youtable where _rowid_=reccount();


>As far as I know, rows are always added to the end of a DBF file.
If you can make sure that last inserted row hasn't been deleted, you can still use:
select * from youtable where recno()=reccount();
or
select * from youtable where _rowid_=reccount();

>I'd like to "ORDER BY rownum DESC",
You can use
select ... from youtable order by _rowid_ desc;

For instance,
select ... from youtable where _rowid_>reccount()-1000 order by _rowid_ desc;
will return the last 1000 rows.

select top 10 ... from youtable order by _rowid_ desc;










Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap