473,387 Members | 1,573 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.

How do I pull latest results when there is duplicate results?

Looking to find a way to only pull the latest results if there happens to be duplicate.

When searching a container in our system, if it doesn't have a dupe I want it to pull that information. But if there is a dupe I want the latest one entered.

Is there a way to look at the created day date time to pull the last one created?
Sep 9 '13 #1
2 1273
Using SQL that is... When the result look like

Pro No. Container Vessel Sailed
559912 GLDU12345678 01/05/2011
1115544 GLDU12345678 3/12/2013


How do I only show the results for Pro 1115544?
Sep 9 '13 #2
Rabbit
12,516 Expert Mod 8TB
Use an aggregate query that returns the max per grouping to join it back to the table.
Sep 9 '13 #3

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

Similar topics

0
by: Soefara | last post by:
Dear Sirs, I am experiencing strange results when trying to optimize a LEFT JOIN on 3 tables using MySQL. Given 3 tables A, B, C such as the following: create table A ( uniqueId int not...
2
by: M.Stanley | last post by:
Hi, I have a problem..I'm doing a specific query where I'm joining fields from a table with appednded data (there are duplicate records, except for the date/time), and another query. I want the...
3
by: Fatz | last post by:
I have a table with a Date Field. This field is populated with the date and time an entry was made to the table. I am looking to create a query that pulls only the most recent record. I am...
4
by: aamircheema | last post by:
Hi, Say I have a table Job with columns name, date, salary . I want to get the name ,date and salary for the date when that person earned maximum salary. I am using something like SELECT...
1
by: dweebe | last post by:
In Oracle10i I am trying to do the following:I want to reject any rows where there are any duplicated result in a certain field. I am focusing on account numbers and want to throw out all the...
7
by: fran7 | last post by:
Hi, I am having trouble with this dropdown. With it I am passing an id to the next page but displaying a description in the dropdown. Trouble is it displays a description for every postid so I am...
1
by: Gabriel Genellina | last post by:
En Mon, 05 May 2008 00:31:45 -0300, Barclay, Ken <Ken.Barclay@schwab.comescribió: No entry in the error log, on the web server? (Apache?) Perhaps you're hitting some internal limit of the cgi...
0
by: Daniel Roy | last post by:
Here's what I came up with (sorry if it doesn't exactly match your example, but I could only work with the info you provided): SQLcreate table latest (person_id number not null, date_entry...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
2
by: Senjalia | last post by:
Hi, Please help me with SQL code that would do Union of two query results NOT having same columns. For example, first result returns columns A,B,C and D and second result returns columns A,B and...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.