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
2 1555
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
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: -
-
SELECT date,item,quantity,balance from total t WHERE date = (SELECT MAX(date) FROM total WHERE item = t.item GROUP BY item)
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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.
...
|
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;...
|
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...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
| |