473,569 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the last row in the table

1 New Member
Hi,
I need to get a last row from the table. Can anyone assist me.

Regards
Nagendra
Jan 4 '07 #1
2 49508
i2eye
5 New Member
It depends on what your table structure is like... say you have a table called table_name, and the identifier is a sequence number called column_id, you can do a subquery... that gets the maximum column_id... then the outer query is to return everything else, see below.


SELECT * FROM table_name WHERE column_id = (
SELECT max(column_id)
FROM table_name );

You may consider looking up Analytical functions as well for a possible solution.
Jan 9 '07 #2
nunnasujatha
24 New Member
There is somthing called Rowid using which u can select the last record from ur table irrespective of the table structure.


ex: this table contains two records as shown
SQL> select * from sujatha_third;

ROLLNO JOINDATE
---------- ------------------
2 07-DEC-06
1 07-DEC-06

SQL> select * from sujatha_third where rowid=(select max(rowid) from sujatha_third);

ROLLNO JOINDATE
---------- ------------------
1 07-DEC-06


i hope this helps u.
Jan 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
548
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int hashFunction(char *key, int elements) ), so the table is an array of dynamic lists. The version of the program I've attached to this message works fine; but...
3
4264
by: John Williams | last post by:
I have a HTML page consisting of several tables at the top level of the DOM, interpersed with other HTML tags. For example: HTML BODY -- SCRIPT -- SCRIPT -- #comment -- SCRIPT -- A
5
1987
by: JackM | last post by:
I need a little guidance putting a script together. I'm trying to read a list of image links from a text file (not a database) and display them in a table on my page. I want to display them in rows of four. I can get my script to work to display the images but I can't figure out how to do two things: 1. How do I get only one image into each...
0
2084
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table id="Table1" GridLines="Both"
9
2599
by: Daniel Kabs | last post by:
Hello there again! On my quest to remove layout tables in favor of CSS controlled elements, I am faced with quite a problem. A table cell that has no explicit width attribute set usually adapts its width to accommodate the content nicely. This is not the case when the content contains floats. I guess floats do not contribute to the...
0
809
by: luna | last post by:
In vs.net 2003 I could hide rows in a table with panels (div) eg table table <panel table panel> table worked fine Im trying the same thing in vs.net 2005
1
1344
by: Banyardi | last post by:
How do I determine who last accessed a SQL 2000 table?
2
1228
by: Griff | last post by:
I have a page with multiple tables, some of which have the class "ClassA". I need to identify the widest table whose class is ClassA. The following JavaScript code returns the table width ("thisTableWidth") when run in FireFox 2.0, but returns '0' when run in IE6. Be grateful for any advice for how to get at this value using IE6.
2
2031
by: Wally | last post by:
Hi there, One table is corrupted. I found compacting is the cause or triggers the process. I have the solution to repair the wrong records but after each compact the same table is corrupted again at the same place. After repairing the table by cutting rows and appending data from outside (sql from coldfusion or from Excel), user may appends...
3
4586
by: SteveP26 | last post by:
Hi guys, I keep getting this error message (below) when I try to run the sql query for my database Heres the code, but the error message only applies to the LAST table (SalesCopy), I have no clue how its any different than the others. SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.