Solved

Delphi 3->SQL->SQLBase 7

Posted on 1998-09-16
2
214 Views
Last Modified: 2010-04-06
I'm using Delphi 3.0 to ask a SQLbase 7 Database.
And I want to know if it exist a direct SQL expression to select the last one created row on a SQLBase7 Table.
Like in ACCESS :
SELECT LAST(column_name) FROM table_name;
0
Comment
Question by:nk51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Jacco earned 10 total points
ID: 1339847
No in real SQL such a thing doesn't exist. (Access isn't realy SQL) This is because a table can be sorted be all of its separate indices.

Now what you can do is if you know the index you sort on is the following:

SELECT
  Max(ColumnName1)
FROM
  TableName
WHERE
  ColumnName2 = (SELECT MAX(ColumnName2) FROM TableName)

This means for a database you have to define what your last item is. In the example you get the highest value of column1 where column2 is highest.

Several other solution are thinkable.

For example: Use a TTable component and do Table.Last; (this sometimes can be very slow though, watch the SQL monitor)

Regards Jacco

(P.S. Does your database system have stored procedure, I have a solution using these)
0
 

Author Comment

by:nk51
ID: 1339848
My database system doesn't have stored procedure.
Thanks for your help.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question