473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

extract last value of particular colum

HI guys, i have a table which has many fiield, actually my problem is that, i want to retrieved the last updated value of a particular column. as for example. what will be condition. suppose, i have a table total, in this table, there is a columns call available. i want to access the last updated value of particular item

date item quantity balance
2007-11-12 book 4 5
2007-11-12 pen 6 6
2007-11-13 pen 12 18
i wan to retrived the value 18.
plz guide me
Nov 23 '07 #1
2 1555
pradeep kaltari
102 Expert 100+
HI guys, i have a table which has many fiield, actually my problem is that, i want to retrieved the last updated value of a particular column. as for example. what will be condition. suppose, i have a table total, in this table, there is a columns call available. i want to access the last updated value of particular item

date item quantity balance
2007-11-12 book 4 5
2007-11-12 pen 6 6
2007-11-13 pen 12 18
i wan to retrived the value 18.
plz guide me
Hi,
One possible solution for your problem would be: As you have the last update date, you can perform an ORDER BY date DESC and then LIMIT 1.

This will give you only the row which was last updated.

- Pradeep
Nov 26 '07 #2
amitpatel66
2,367 Expert 2GB
HI guys, i have a table which has many fiield, actually my problem is that, i want to retrieved the last updated value of a particular column. as for example. what will be condition. suppose, i have a table total, in this table, there is a columns call available. i want to access the last updated value of particular item

date item quantity balance
2007-11-12 book 4 5
2007-11-12 pen 6 6
2007-11-13 pen 12 18
i wan to retrived the value 18.
plz guide me
Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT date,item,quantity,balance from total t WHERE date = (SELECT MAX(date) FROM total WHERE item = t.item GROUP BY item)
  3.  
  4.  
Nov 26 '07 #3

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

Similar topics

9
by: jason | last post by:
Access 2000 I need some help interogatting a table and extracting via ASP the final field in a row which has a value. In other words, I have a maximum of 10 fields but, at the user level he may...
4
by: rdraider | last post by:
Is there a function that will extract part of a string when the data you want does not occur in a specific position? Field "REF" is varchar(80) and contains an email subject line and the email...
2
by: Uthuras | last post by:
Greetings all, Machine : PENTIUM Os :Windows 2000 Product : DB2 UDB EE Release : 7.2 I've extracted data from a RDBMS database and try to load into DB2 database. I extracted the...
44
by: RB | last post by:
How to extract bytes from long, starting from the last byte? For example, I have a long number: 0x12345678 I need to represent it as the following bytes list: 0x78, 0x56, 0x34, 0x12 Thanks in...
0
by: Amber | last post by:
There are times when you will need to highlight or otherwise modify the contents of a particular DataGrid row-column value based upon the value in the column. In this example we will select the...
5
by: mail | last post by:
Urgent help needed! I moved an application from ASP+ACCESS to ASP+MS SQLSERVER and I have the following problem: If the join on two tables results on duplicate colum names (which appear in...
7
by: harvey | last post by:
What is the easiest way to get both the last item name and last item value from an associative array? I can get the value with array_pop() but can't see anything similar for the item's name. ...
8
by: Guy | last post by:
Is there a better way to search identical elements in a sorted array list than the following: iIndex = Array.BinarySearch( m_Array, 0, m_Array.Count, aSearchedObject ); aFoundObject= m_Array;...
3
by: Kamaraju | last post by:
Hi I have a XML code. Can anyone suggest me as to how i can extract the value of a particular tag like <Root> <Title> <Cost> 100 </Cost> </Title> </Root> I want to extract the term...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...

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.