[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Delphi 3->SQL->SQLBase 7

Posted on 1998-09-16
2
Medium Priority
?
226 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 30 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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