How to get only latest date and other columns in the table
HelloTable
id name date
123 a 2/3/2010
124 b 15/2/2010
125 c 1/1/2010
123 a 12/4/2010
125 c 17/2/2010
It's a table, id, name, date here is the composite key.I want to select id, name, and date so that date (e.g., 123 date 04/12/2010 be selected for the id) is selected for each id and each id and name should be selected once.
So, what will be its application?
Thank you
select
id,
name,
date
from
(
select
id,
name,
date,
max(date) over (partition by id, name) as max_date
from your_table
)
where date = max_date;
Would do assuming you do not have duplicates (all 3 columns) in the table.
Tags: Database
Similar Questions
-
Hi all;
I'm new at VMAs, I put it in place and adds 5 Server esxi 4 and I can list the fines using vifp lists broadcast and works, very well but my problem is I want to interrogate the remote servers for this vMA host for example I need to check the contents of these files
cat /etc/resolv.conf
cat/etc/sysconfig/clock
tail/var/log/vmkernel
Discovered the following
esxcfg-firewall - q and esxcfg-vswif - l
Can someone please help me on how to run these commands or another way on how to get this information above hosts and ESXi 4. I checked the forum, but I don't see anything similair nature! now, either I'm stupid full because it's as simple as drinking water and so no one asked or I am just lucky to ask the right question, so be it, I appreciate your time and effort
Thanks in advance
Esxlinux
So its worth your time through the vMA documentation to understand how to manage your hosts and it's main use case. The operations that you are trying to accomplish cannot be done using vMA... at least in the way that you are hoping for.
See my vMA article and some of the getting started guides.
cat /etc/resolv.conf
You will want to use esxcfg-dns to list the configured DNS servers
cat/etc/sysconfig/clock
This file does not yet exist on ESXi, if you try to set the time on ESXi host, you should use NTP and it is also important to note that single ESXi uses UTC and no other options are available.
tail/var/log/vmkernel
If you need to display the host logs, consider using vi logger on vMA OR configure syslog on your host to send to the centralized syslog server
Regarding the last two commands, they do not apply to an ESXi host and therefore these commands are not available.
There are certainly differences between ESX and ESXi, understand the differences and orders to ask for certain pieces of information is very important. vMA can help with this, but you must understand the use case of vMA and what tools are at your disposal. The best way to start is to take a look at the documentation, to jump it and try to jump in, will just be confusing.
Good luck
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware scripts and resources at: http://www.virtuallyghetto.com/
Introduction to the vMA (tips/tricks)
Getting started with vSphere SDK for Perl
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
How to view only selected data TextInput should appear in the DataGrid
Hello
I have a lot of data on my Datarid displayed using an ArrayCollection as a dataprovider collection.
I want to use the filtering of the features of the ArrayList.
I have a TextInput, and when her sweat gets into a text, so I want to only data related using appears only on the data grid.
I tried this, but I've hit upIt's my ArrayCollection collection
< mx:ArrayCollection id = "arraycoll" >
< mx:Object >
< mx:name > happy < / mx:name >
< mx:pass > keyboard < / mx:pass >
< / mx:Object >
< mx:Object >
Kiran < mx:name > < / mx:name >
< mx:pass > keyboard < / mx:pass >
< / mx:Object >< mx:ArrayCollection >
It comes to my DataGrid
< mx:DataGrid dataProvider = "{arraycoll}" = XY = "199" width = "300" height = "300" "329" visible = "true" >
public void (SearchData): Sub
{
arraycoll.filterFunction = doFilter;
}
private void doFilter(item:Object):Boolean {}
var searchString:String = myTextIp. text.toLowerCase ();Need a logic here
}< mx:TextInput id = "myTextIp" name = "SeacrhName" change = "SearchData ()" >
For example, if a user presses Ra to TextInput so I want to display only as Ravi on to DataGrid.
Help, please.
Hello
Try this
private function doFilter(item:Object):Boolean { var searchString:String = myTextIp.text.toLowerCase(); if (item.name.search(searchString) == 0) return true; else return false }
-
How can I only restore contacts and calendar but not the system after factory reset settings?
Hello
I have an iPhone 5. I forgot the password of restrictions long ago and no backups prior to that date. I want to do a factory reset. How can I do this while keeping a copy of my contacts, notebooks, lists and schedules, so I can re - sync after the reset? I don't want to re - sync system settings that my backup plays up and want to do a clean install of the main parameters.
All advice appreciated.
Chris
You need to store your contacts and calendars on your computer or Cloud Computing service.
AR you not do?
-
How to get to a slide and be there at the end?
I want students to be able to go back to a slide, but when they do, I want this slide to its last image. That's when they don't need to listen and wait for the audio and text synchronization. Help, please!
Users always use the 'next' button to advance? This means that the last image they visited is the one just before the point of pause. You will need to store this image number in a user variable. This means a variable for each slide. Then use the action on enter the slide to check if this variable is a number, in this case micro - access this frame number, otherwise, just use continue. Maybe I should blog about implemented? I used the micro-navigation in my last blog post, but it was for a simple replay button.
-
How to assign a value to an attribute column in the table in the ADF
Hi all
BindingContext ctx = BindingContext.getCurrent ();
DCBindingContainer bc = (DCBindingContainer) ctx.getCurrentBindingsEntry ();
Iterator DCIteratorBinding = bc.findIteratorBinding ("StudentVO1Iterator");
Line r = iterator.getCurrentRow ();
FacesContext facesContext = FacesContext.getCurrentInstance ();
Application app = facesContext.getApplication ();
ExpressionFactory elFactory = app.getExpressionFactory ();
ELContext elContext = facesContext.getELContext ();
ValueExpression valueExp =
elFactory.createValueExpression (elContext, "#{data.") StudentAMDataControl.dataProvider} "(,Object.class);"
AMEST StudentAMImpl = (StudentAMImpl) valueExp.getValue (elContext);
String newno = amest.getEstNoGenerate ();
System.out.println ("new number" + newno);
r.setAttribute ("StudentNo", newno);
BindingContext ctxdet = BindingContext.getCurrent ();
DCBindingContainer bcdet = (DCBindingContainer) ctxdet.getCurrentBindingsEntry ();
DCIteratorBinding iterdet = bcdet.findIteratorBinding("StudentDetailVO1Iterator");
Line rdet = iterdet.getCurrentRow ();
System.out.println ("row" + rdet); print null
rdet.setAttribute ("DtlStudentNo", newno);
in code above my header part can affect return value, but the level of detail, it cannot affect. which shows nullpointer exception. because the Row rdet object become null. Why does this happen? it comes out when I press a button.
I code in backing bean Tin and running on the commercial version of jdeveloper 11g 2...
help jumping... anyone who knows...
Thank you.A good starting point are the docs (http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcentities.htm#sm0126).
Example http://dstas.blogspot.de/2011/10/master-detail-data-presentation-and.htmlTimo
-
How to get back my data for the health and the watch Apps once I've restored my phone?
How to get back my data for the health and the watch Apps once I've restored my phone?
From the backup, you're going to be restoration.
If you back up to iTunes, make sure that it is an encrypted backup.
-
Original title: deleted user accounts.
Hi guys,.
I want to know the activities of a user whose account has been deleted. How can I get the history, SID and other details of the accounts of users deleted in Windows XP, 7 and 8?
Hello
Thanks for posting in the Microsoft Community.
There is no newspaper available for the activities of the user. There are just a few activities of windows and the error logs is stored in Windows.
Hope this information helps.
If you need help to resolve any issues related to Windows, please reply and we will be happy to help you.
-
I have a MacBook Pro 17 withProcessor - in 2.33 GHz Intel Core 2 Duo (circa 2007). Running OS 10.7.5 (Lion). System indicates the computer is not compatible with OS later. Hardware can be upgraded to the latest processors and other components to make it compatible with the latest OS. I think that later models of Macbook Pro 17-inch with processors that allow updates. I was wondering if these can be swapped or if alternatives were available.
Only the RAM and storage (HD, SSD) can be changed. Everything is welded to the map logical and selected specially for the system configuration.
I'm sorry.
-
How can I fix a black and white screen on the air from my iPad? I rebooted it and ran the last updated IOS 9.2 on it. It is stuck and won't return to the color. All other functions work except this.
Have you checked the settings > General > accessibility > greyscale > power off.
If this does not work ty settings > General > accessibility > zoom > on. Triple, tap the screen with three fingers. Tap choose filter. Click None. Triple, tap the screen to get rid of the menu zoom. If you have enabled greyscale in zoom you can disable it in zoom.
-
How to get help in downloading and installing 12 EP and 12 first on Win 8.1?
How to get help in downloading and installing 12 EP and 12 first on Win 8.1?
Try using a different browser if you experience a problem for the interface to respond correctly to your interaction with it. If you need help, preovide more information about what you feel when you tru and it fails.
Please don't start no multiple views for the same problem - your other display information better.
-
ODI:i need to get a RDBMS data and put it in a file with EBCDIC enc
I need to get data from an RDBMS and put it in a file with EBCDIC encoding using ODI
I know how to get data and put it in the file using ODI, but do not know how to EBCDIC coding the file using ODIHello
Its very simple.
You must specify the encoding code in the JDBC URL of the server in the topology Manager data file.
For example,.
JDBC:SNPs:DBFile? ENCODING =
You can get your codes coding supported by ODI from here,
http://download.Oracle.com/docs/CD/E17476_01/JavaSE/1.4.2/docs/guide/Intl/encoding.doc.html
Thank you
Guru -
How to buy only a few songs, without registering for the new service? It seems compulsory now, and I DON'T want TO. Could someone tell me just for the selection of the menu where I can search for a song by keyword and buy it?
If it's on your iPad, then go to the app Store in iTunes, you can buy music from there
If you do not want to use Apple music then turn it off on your iPad via the settings > music > Music Show Apple 'off '.
-
How to monitor my cpu heat and other items on my desktop HP Pavilion p6210f
How to monitor my cpu heat and other items on my desktop HP Pavilion p6210f
Lawrence123456,
The applications are numerous, but I use:
http://www.cpuid.com/downloads/HWMonitor/1.19-Setup.exe
-
How to get slideshow to pause and restart with AutoPlay enabled? Is happening in all the slideshow does not restart once a picture is selected
tytothoughts It is a very old thread, in the grand scheme of things. In the current version, you can set slideshows and compositions to restart after a while after having been suspended.
David
Maybe you are looking for
-
Hello I have a computer laptop g6 - 11170ev 3 years now. I wanted to clean the fan and attached to open it. But I saw tha he is very difficult to reach the fan and I quited. FYI I didn't remove all screws and clips while I was trying to open it. My i
-
How to save the program to Flash diving
My netbook has no cd player. How can I return/copy of program mechanic IOLO system on a flash drive to use on my netbook?
-
I have 4 games installed by CD I played for months, with no problems. We had the power to go out and I turned it off so it wouldn't be a problem when the power came. Reconnected everything, the next day and when I tried to access ONE of the games I h
-
Quick question of blackBerry Smartphones on changing the time on my phone
I noticed that the time on my phone is 5 minutes in advance. I tried to change it. But I can't seem to do. I put it so the network time in the date/time menu, it says time network is example: 14:08, but when I go to my house it displays the time as 1
-
Illustrator CC crashes after a while of use.
Hi, I just downloaded the suite yesterday and thought I would try HAVE today. I can open the program without problem. Open files, create files and work on them, then save them along the way. Then after about 10 minutes, it freezes. I can't click on a