Need to find the version number referring to the last name change for each emplid.
emplID | Name age | Version | ||
--- | ----- --- | -------- | ||
1 | ABC | 25 | 2 | |
1 | ABC | 26 | 5 | |
1 | def | 27 | 9 | |
1 | def | 28 | 15 | |
1 | def | 29 | 18 | |
2 | JKL | 15 | 5 | |
2 | MNO | 16 | 8 | |
2 | MNO | 17 | 11 | |
2 | PQR | 18 | 20 |
Need to find the version number referring to the last name change for each emplid.
As indicated by the version number change when there is change in age as well, but I need a query that gives the version number referring to the last name change for each emplid.
with
DATA_TABLE (EmplId, Name, Age, version) as
(select 1, 'abc', 25, 2 double Union all
Select 1, 'abc', 26, 5 Union double all the
Select 1, 'def', 27, 9 double Union all
Select 1, 'def', 28, 15 double Union all
Select 1, 'def', 29, 18 double Union all
Select 2, 'jkl', 15 5 Union double all the
Select 2, 'mno', 16, 8 double Union all
Select 2, 'mno', 17, 11 double Union all
Select 2, 'pqr', 18, 20 double
)
Select emplid,
Max (Name) name of Dungeon (dense_rank last order by version).
Max (Age) age of Dungeon (dense_rank last order by version).
version Max (version)
from (select emplid, name, version,)
-case where name! = lag(name,1,name) on (emplid version order partition)
then "renamed".
end change
of data_table
)
where the change is not null
Emplid group
EMPLID | NAME | AGE | VERSION |
---|---|---|---|
1 | def | 27 | 9 |
2 | PQR | 18 | 20 |
Concerning
Etbin
Tags: Database
Similar Questions
-
How to find the first max value for each item
Hello
I have the me_result of the table as below,
SELECT * FROM me_result;
ID ||| ELITE ||||||||||| FREQ_ITEM | COMBINED_STR | SUP
1 ||; 1; 10; 2; 3; 4; 5; 7; 8. 1 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
2 ||; 1; 10; 2; 3; 4; 5; 7; 8. 2 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
3 ||; 1; 10; 2; 3; 4; 5; 7; 8. 3 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
4 ||; 1; 10; 2; 3; 4; 5; 7; 8. 4 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
5 ||; 1; 10; 2; 3; 4; 5; 7; 8. 5 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
6 ||; 10; 2; 3; 4; 5; 8; 9. 1 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9; 1 ||| 1
7 ||; 10; 2; 3; 4; 5; 8; 9. 2 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
8 ||; 10; 2; 3; 4; 5; 8; 9. 3 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
9 ||; 10; 2; 3; 4; 5; 8; 9. 4 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
10 ||; 10; 2; 3; 4; 5; 8; 9. 5 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
I need to find the first COMBINED_STR max for each element of the ELITE,
I mean, max value is the max REGEXP_COUNT (combined_str,' ;')))
really, I try to write down, but I had a lot of values for each ELITE and I need only the first, that
SELECT * from me_result
WHERE (ELITE, REGEXP_COUNT (combined_str,' ;')))) IN
(SELECT ELITE, MAX (REGEXP_COUNT (combined_str,' ;'))))) ME_RESULT ELITE GROUP);
I need the result to be as below.
1; 1; 10; 2; 3; 4; 5; 7; 8-1; 1; 10; 2; 3; 4; 5; 7; : p
6; 10; 2; 3; 4; 5; 8; 9 1; 10; 2; 3; 4; 5; 8; 9; 1 1
any help please,.
Published by: user11309581 on July 10, 2011 22:03Can be
with t as (select 1 ID, ';1;10;2;3;4;5;7;8' ELITE, 1 FREQ_ITEM, ';1;10;2;3;4;5;7;8' COMBINED_STR, 2 SUP from dual union all select 2 ,';1;10;2;3;4;5;7;8' ,2 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 3 ,';1;10;2;3;4;5;7;8' ,3 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 4 ,';1;10;2;3;4;5;7;8' ,4 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 5 ,';1;10;2;3;4;5;7;8' ,5 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 6 ,';10;2;3;4;5;8;9' ,1 ,';10;2;3;4;5;8;9;1' ,1 from dual union all select 7 ,';10;2;3;4;5;8;9' ,2 ,';10;2;3;4;5;8;9' ,2 from dual union all select 8 ,';10;2;3;4;5;8;9' ,3 ,';10;2;3;4;5;8;9' ,2 from dual union all select 9 ,';10;2;3;4;5;8;9' ,4 ,';10;2;3;4;5;8;9' ,2 from dual union all select 10 ,';10;2;3;4;5;8;9' ,5 ,';10;2;3;4;5;8;9' ,2 from dual ) select ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP from ( SELECT ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP, ROW_NUMBER() over (PARTITION BY ELITE order by id) RN FROM t WHERE (ELITE,REGEXP_COUNT(combined_str,';')) IN (SELECT ELITE,MAX(REGEXP_COUNT(combined_str,';')) FROM t GROUP BY ELITE) ) where RN=1 order by id ID ELITE FREQ_ITEM COMBINED_STR SUP ---------------------- ----------------- ---------------------- ----------------- ---------------------- 1 ;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8 2 6 ;10;2;3;4;5;8;9 1 ;10;2;3;4;5;8;9;1 1
-
How to find the Maxima and Minima for each column of a 2D array?
Hello
I have a 2D chart and I would find the maxima and minima of each column of the 2-D table. Even though I know how to get maxima and minima for the whole picture but don't know how columnwise? Any ideas please?
Thank you
Rohit
Hello
@Smercurio-What you said is true, I should have shown using automatic indexing enabled which is really excellent choice. I just tried to show in a very simple way.
Anyway, here's the best way
-
How to find the last schema change hour?
Hello. I would like to get the following info on our list of schema full of db (11 GR 2 Linux x 64) and every scheme of last modification time (so, if changes have been made in any table, etc.). It is may also get info about who was last modifier, but if I understand correctly, it is not possible without verification turned on?DML changes is not something Oracle titles unless explicitly, you're doing something like enable auditing.
There should be that all the tables in the full schema of analysis, but you could do
select max(ora_rowscn ) from schema_name.table_name
and choose the largest value. Assuming that you care cuts, that would give you the SCN for the last INSERT or UPDATE on a table in the schema. If the last such change was relatively recent, you can convert it into a timestamp by calling SCN_TO_TIMESTAMP. But this mapping is only kept for a few days. If "long" means more than a week, and then you try to extrapolate a SNA in time which is likely to be very error-prone.
Justin
-
Are there records of the sys the timestamp of change for each table?
I noticed that the sys "object" records just the creation and the timestamp of DDL operation.
But I need the timestamp of change (for example, insert, update, delete, etc.) for my paintings. Otherwise, I fear that I must create the trigger for each table it's hard work.You can use scn_to_timestamp (max (ora_rowscn)) for the dml changes
-
The worksheet name change for the interactive user role
Hi all
I have a question about DRM security for users with access add to the sheet and only read access to the members. The requirement is that the user should be able to add a sheet and change all the properties associated with the leaves but cannot add or change the Member or any property associated with a branch. To do this, I created a group of node (NAG1) and assigned categories of goods (PC1) associated with the hierarchy of the NAG1 with editing access to PC1. The NAG1 for journal access ADD and NAG1 for branch had read access. The user has only one role which is the interactive user. This way, the user cannot add spreadsheets, edit the properties associated with the leaves, but don't can't add limb or change all the properties associated with limb, HOWEVER, the user is not able to change the name of an existing journal. If I give the user role 'Director of Application', while they are able to change the name of the system, but then they see the section Administration on the left and everything related which we want give...
Is it possible to give the user the ability to change the name of the worksheet without giving ""Application Administrator ' role? "
Thanks in advance
Sumit
Have you checked RenameLeaf and RenameLimb system preferences? I think that by default, only the administrator can change the name of the node, but you can grant this possibility of additional roles.
-
Where can I find the last security fix for CF 9.0.2?
ZDNet announced there that a security fix for ColdFusion provides but no link to where I can read about it or download it. I go to the Adobe site and search by navigation and research and can't find it. It is well hidden.
Maybe ZDNet has been announced before Adobe update their website? Or maybe I just can't find what is obvious to others.
Adobe has released yesterday, just know where to look: http://helpx.adobe.com/security.html is up to date with the latest news from the Adobe security team. More specifically, you are looking for: http://helpx.adobe.com/security/products/coldfusion/apsb14-23.html
--
Pete Freitag
Foundeo Inc.. -Manufacturers of HackMyCF
-
Find the last character in a string aplhanumreic
Hi guys first time poster long time hiding in the shadows, I hope someone can help me
I put the stored username and I need to find the last character before the number, for example
ABC123 that I would like to find c
AB123 I would find b
suggestions as to how I could do this?
Thanks in advanceHere's one way:
-
I can't find the profile of lens for Sony 28 mm f2.
I need to find the profile of lenses for the Sony 28 mm f2. When I look at lenses profiles in Lightroom there seems to be only one for Sony (18-200). I'm sure that there is a profile for this goal, as I saw that it made reference in line several times. Any help is appreciated...
Profiles should work perfectly with the DNG files as DNG format is a raw file. Technically speaking, I do not think there is any downside to working with DNG files.
-
Find the last characters with grep
I'm lousy with grep and didn't find the solution with google, we will so ask here (help me, please...)
I need to find the last 7 characters in a paragraph and assign a character style "not break". I know that all the rest, but what is the string to find the last 7 characters (white space included, numbers and letters).
Thanks in advance.
try searching. {7} $
-
The update to version 2 of Vitsa fail. Formatted hard drive to purchase the version. need to find the final vista product key
It should be on a sticker on the box, or on the packaging.
The product key consisted of 25 digits, divided into 5 groups of 5 digits.
See you soon...
Mick Murphy - Microsoft partner
-
I need to find the 32-bit version of bootsect.exe.
Need the 32-bit version of bootsect.exe
I need to find the 32-bit version of bootsect.exe. I downloaded Windows 7 Pro 64-bit version of Digital River to upgrade my Dell Inspion Windows Vista Home Premium 32 bit. I can't download boosect.exe from the Microsoft Store because I Win 7 through Digital River. Where can I download this small file. Someone has to have it. Thank you.
If you need the 32-bit version because you can't start download 64-bit here is how to make bootable download and install.
Create installation DVD or Flash USB in Windows 7 download
According to what you have downloaded (ISO or .box) and what you have available, you can use one of the links below to create bootable media. Use the methods of USB flash drive, your flash drive must be 4 GB or more. You could also buy the installation DVD if you wish.
DVD from ISO - if you downloaded the ISO file use a burning program to a DVD. You can also use the USB/DVD Windows 7 download tool allows you to create a copy of your ISO of Windows 7 file on a flash drive, DVD or USB.
http://store.Microsoft.com/help/ISO-tool
http://pcsupport.about.com/od/toolsofthetrade/HT/burnisofile.htmDVDS from files .box - if you downloaded the. EXE &. Box follow these instructions to make a bootable from download Windows 7 DVD:
http://www.TomsHardware.com/Forum/1392-63-Windows-upgrade-bootable-guide-having-issuesUSB Flash ISO - if you downloaded the ISO file and you want to install Windows 7 using a flash drive:
Windows 7 USB/DVD Download tool allows you to create a copy of your ISO of Windows 7 file on a Flash DRIVE or a DVD. To create a bootable DVD or USB flash drive, download the ISO file and then run the Windows 7 USB/DVD Download tool. Once this is done, you can install Windows 7 directly from the Flash DRIVE or a DVD.
http://store.Microsoft.com/help/ISO-toolUSB stick installation files - WinToFlash is a practical application that will help you transfer your Windows 7 installation from a hard drive or DVD to USB flash in a few steps. That you can install Windows 7 from a flash card, USB stick, HDD, etc to your computer or netbook. If you have downloaded the .box file extract everything first. If you have a 4 GB or more large USB key (or external hard drive), and the computer can boot from USB:
http://www.Softpedia.com/get/system/system-miscellaneous/WinToFlash.shtmlThen:
32-bit to 64-bit custom clean installation stepsYou can use a disk upgrade, but you cannot make a room upgrade from a 32-bit system on a 64-bit system, the only way is to do a custom clean install. This means that you will have to reinstall all your programs, but you can save your files and settings on an external storage before that with Windows Easy Transfer. According to Microsoft the following steps:
1. start Windows Upgrade Advisor (http://windows.microsoft.com/en-US/windows/downloads/upgrade-advisor ) to see if there are known issues that may affect the installation and the question of whether you should install the version of 32 or 64 bit Windows 7.
2 back up your files and settings. To avoid losing everything that you will need to save copies of all files, photos and other information that you want to keep an external hard drive. Windows Easy Transfer (http://windows.microsoft.com/windows-easy-transfer ) is a free tool that you can use to copy your information (but not programs) from your PC and then put them after installing Windows 7. If you do not have an external hard drive, you will not be able to use Windows Easy Transfer, instead you can copy the files you want to keep on a USB stick or CD/DVD.
3. find the discs original installation and license/product keys associated to programs currently on your computer because you will have to manually reinstall your programs after installing Windows 7. You may be able to download programs from the Internet.
4 Medallion the Windows 7 DVD in your PC, reboot, start of the DVD. When asked "which type of installation do you want?" click "Custom (advanced)."
5. when Windows 7 is installed, you can use Windows Easy Transfer to restore your files & settings and use your installation diskettes to install all your programs.
Questions about installing Windows 7?
FAQ - Frequently Asked Questions from Installation Windows 7 & responses -
I tried a trial version of lightroom 6 and edited hundreds of photots I need to find the export files are small non-printable, about 600 kbs. So I bought lightroom 6 hoping to save my changes on all the photos. However with my purchase of more than a week, my picture exports are still about 600 kbs. Not printable! I'm signed and registered. Whats happening?
Looks like you have been in the library module and chose with a preset export or export to email. Whatever it is, your Presets 'export' were to reduce the size of the image exported to about 600 k.
In Lightroom, the library module and under the file menu, simply select the Word Export. Who will open another dialog box. GO through each option in this dialog box to choose where you want to export the file, what color space to use, what name to give to each folder, what metadata to include and do not forget to select the export size! I included a few screenshots for your reference.
If you export exactly the same path several times, you can create your own export preset to make this process faster.
-
Need to find the common number
Need to find a common number among all of the calls:
Create table call (key id Number (15) not null, mobile_number number primary (10), other_party number (10), call_type varchar2 (10), the call_date_time date, number (15)) duration;
insert into values of the call (1,9818764535,9899875643, 'IN', to_date (24 April 13 02:10:43 "," dd-MON-yy hh24:mi:ss'), 10);
Insert in appeal values (2, 9897451236,9899875643, 'OUT', to_date (April 28, 13 08:11:13 "," dd-MON-yy hh24:mi:ss'), 20);
Insert in appeal values (3, 9899917277,9899875643, 'IN', to_date (30 April 13 18:07:02 "," dd-MON-yy hh24:mi:ss'), 30);
insert into values of the call (4,9818764535,9215478213, 'IN', to_date (1 May 13 02:11:13 "," dd-MON-yy hh24:mi:ss'), 40);
Insert in appeal values (5, 9899917277,9215478213, 'IN', to_date (1 May 13 08:17:02 "," dd-MON-yy hh24:mi:ss'), 25);
Insert in appeal values (6, 9897451236,9012451785, 'OUT', to_date (1 May 13 20:21:04 ',' dd-MON-yy hh24:mi:ss'), 67);
Query criteria:
common calling to the list of numbers that is in contact with the listed numbers.
Mobile_number entry:
9818764535
9897451236
9899917277
exit number common
Mobile another numberlength part Date_Time
9818764535 9899875643 24 APRIL 13 02:10:43 10
9897451236 9899875643 28 APRIL 13 08:11:13 20
9899917277 9899875643 30 APRIL 13 18:07:02 30Hello
One way is to encrypt the target in a table game or result, as above, knapen don't:
WITH input_number AS ( SELECT 9818764535 AS mobile_number FROM dual UNION ALL SELECT 9897451236 FROM dual UNION ALL SELECT 9899917277 FROM dual ) SELECT * -- or list columns wanted FROM call WHERE mobile_number IN (SELECT mobile_number FROM input_number) AND other_party IN (SELECT mobile_number FROM input_number) ;
-
Need to find the correct reference for replacement screen Aspire 5742
Hello
I need to find the correct part for replacement screen Aspire 5742. The backlight does not work anymore, and I already bought a UPS to see that this model/version does not use a UPS (as the backlight is LED and integrated in the element of the screen). I find the somewhat confusing model numbers table. The full model version seems to be:
5742 - 464G50Mnnk
S/N: [redacted to comply with guidelines]
SNID [redacted to comply with guidelines]
This seems to be a very good laptop that belongs to a mine Guigou, but not worth repair at the local dealership, and I'm sure I can replace the screen myself if I can get the right part, having already dismantled the set of sieves and to be an electronic engineer.
Either way, I guess that this version of model is the 5742, not the 5742 G (even if the model number has a 'G' in it: some of the confusion). Any help would be appreciated.
Part numbers for the 15.6 TFT LCD for the Aspire 5742 are:
LK.15605.004
LK.15605.010
LK.15606.009
LK.15608.007
LK.15608.011
LK.1560A.004
LK.1560D.010
LK.1560E.004
LK.15605.019
LK.15606.012
Maybe you are looking for
-
Bluetooth SPP very slow on the macbook 13 retina early 2015
I use the Bluetooth SPP profile much download code the arduino-based robots in my classes. This used to work fine on a Macbook (13-inch late 2011) unibody + Yosemite, but since I have upgraded to a Macbook 13 beginning 2015 retina, transfers are > 20
-
Hello, can I update my blackberry playbook app with data from my blog?, my application talks of tips, a blog is possible to synchronize data, that whenever I have update the blog or facebook, thanks
-
Verizon and blackBerry Passport
If I want to buy a passport, but have and want to stay with Verizon, I just buy the passport and see if it is compatible with Verizon, then return it if it is not compatible?
-
Hi all I use a persistent storage to store my data. Question: Persistent data are automatically get updated while recovery of persistence data and store it in a variable local object and then modify this local variable, observe that the persistent da
-
my company just went with a gmail pro account - so I now have an email like [email protected]. It is a gmail account and I would like to put up on my pre. I already have my personal email set up on the [email protected] pre - and that works