Results 1 to 6 of 6
Thread: How to find latest inserted rows
- 06-20-2011, 12:28 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 8
- Rep Power
- 0
How to find latest inserted rows
Hi,
I am having a table where same barcodes will be inserted for a project repetetively. My problem is I want to retrieve all the barcodes for that project which are inserted latest and these barcodes are might be previously allocated or new ones or both.
Searched google but found there is no function or predefined variable like rownum in mysql. The queries available in all the forums are using desc and limit but I cant use them as I dont know how many barcodes will be inserted for a particular project again they might be same or more or less in this case I cant use limit.
If my table is having the following records:
barcode insertdate projectid
10009 2011-04-29 1
10037 2011-05-01 1
10444 2011-05-02 1
10019 2011-04-30 2
10047 2011-05-03 2
10464 2011-05-05 3
10009 2011-05-05 1
10037 2011-05-07 1
10464 2011-05-07 1
10444 2011-05-07 1
I want to retrieve all the records of project 1 inserted for the second time only.
Pls help me in getting the result.
--Regards,
raaja. g
- 06-20-2011, 04:11 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
If you are entering the dates, just select the project id and the max date
- 06-20-2011, 04:30 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
- 06-21-2011, 06:48 AM #4
Member
- Join Date
- Dec 2009
- Posts
- 8
- Rep Power
- 0
How to find latest inserted rows
Hi,
But I need all the records which are inserted latest for project 1. I dont want only the duplicates.
--regards,
raaja. g
- 06-21-2011, 07:55 AM #5
Member
- Join Date
- Dec 2009
- Posts
- 8
- Rep Power
- 0
How to find latest inserted rows
Hi,
What I need is last entry of all the barcodes of a particular project.
--raaja. g
- 06-21-2011, 09:26 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Similar Threads
-
Play the latest
By jsntg in forum New To JavaReplies: 3Last Post: 10-08-2010, 04:43 AM -
count inserted line in database
By tedy2808 in forum New To JavaReplies: 3Last Post: 08-16-2010, 10:57 AM -
How to Update newly inserted rows in the Excel through Java..Pls help..Explained well
By josephkarthic in forum New To JavaReplies: 2Last Post: 03-16-2010, 08:24 PM -
Using escape sequence to find rows begining with %
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 10:00 AM -
Preventing inserted text from becoming colored from previous style
By jkhoa in forum AWT / SwingReplies: 2Last Post: 08-10-2007, 12:36 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks