Select distinct rows only and also remove the distinct rows tied with anyother records.
HI Team,
I need query on below requirment:
In my table any value comes with UN in one field alone, i need to select that row. but UN value comes with anyother row i want to reject that UN row.
For example:
EmployeeID
Name
Speciality
1
John
UN
1
John
KH
2
Mony
UN
3
Kash
UN
3
Kash
UI
I need a Final result
1 John KH
2 Mony UN
3 Kash UI. Need to reject UN value combined with anyother row aand also If any row comes with UN value alone need to incude resultset.
One more option:
declare @tabl table(EmployeeID int,Name varchar(10),Speciality varchar(10));
insert into @tabl values
(1 ,'John','UN'),
(1 ,'John','KH'),
(2 ,'Mony','UN'),
(3 ,'Kash','UN'),
(3 ,'Kash','UI'),
(4 ,'Cat','UN'),
(4 ,'Cat','UT');
with cte as (SELECT *,
count(case when Speciality ='UN' then NULL else 1 end) OVER (PARTITION BY EMployeeID,Name,Speciality ) AS RN1,
count(case when Speciality ='UN' then NULL else 1 end) OVER (PARTITION BY EMployeeID,Name ) as rn2
FROM @tabl)
select EmployeeID,Name,Speciality from cte where RN1=rn2
Similar Messages
-
I have a MacBook Pro through my college, and I have all my iCal items on that computer, but I have all my music, apps, etc. on a PC desktop that is my personal home computer. I am wondering if I can sync my iPod touch with my MacBook for the iCal items and also with my PC for the music and such without loosing either of the two when trying to sync with the other computer?
Have a look Here > Managing content manually
From Here > http://www.apple.com/support/iphone/syncing/ -
It's a Magic Mouse question. I have set this up in Preferences by ticking Swipe between pages with one finger and also Swipe between full-screen apps with two fingers, however when I try to do the latter, the 2 finger swipe will take me from the app that I am on to the dashboard only and not to my other open apps.
I also find that Smart zoom only works with some apps, for instance not with Word docs or email.
How can I correct this please?Just figured out it also does not work with the Mail app.
-
The installation of the new system caused the heating equipment and also warming the bellman who tease her and burning so now discovered that the source of this 60w no longer being sold in BRAZIL had to buy a power 85w.
The installation of the new system caused the heating equipment and also warming the bellman who tease her and burning so now discovered that the source of this 60w no longer being sold in BRAZIL had to buy a power 85w.
-
How do I remove the last row in a csv data file
I would like to remove the last row of data from a csv file that I have saved. I can identify the start byte of the last row; however, I'm not sure what tool is the best one to remove it. Should I move the EOF? Should I open the file up to that point then save over the old one? Is there another way I don't know about? I am using labview 7.1.
ThanksI would use the Read Text File. You can right-click on it and tell it to read lines. Then Delete From Array. Leave the index and length unwired and it will delete the last item (I noticed your code is removing the second line). Then open the file again set to replace or create and write your data. This method allows you to propagate your errors instead of the Write/Read Spreadsheet File handling the errors for you.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Remove last row of csv_BD.png 14 KB -
I bought the Tiger woods 12 game for my ipad and also paid the 19.99 for the $2M. It has crashed my ipad a few times and when it restarted last time, it had no history of my progress or the $2M. How do I get my history back or my money back for the game and the in-game expenses?
The only one that can issue a PUK code is a carrier, which you've already made clear you don't have.
If itunes does not recognise your ipad that may be another issue. What version OS is on your computer and what steps did you follow to uninstall itunes and then reiinstall itunes on your computer?
And, do you at least see the sidebar on the left hand side of itunes?
iPad not appearing in iTunes
http://www.apple.com/support/ipad/assistant/itunes/
Do you have another computer you can try? -
Hi,
I need to change the country for my Apple store account but this message appears "You have a store credit balance; you must spend your balance before you can change stores." but my credit is 1.58$ only and I couldn't buy any app with this amount! Any way how to fix that and I don't have a problem if I lose this 1.58 $?If you can't spend it then you can try contacting iTunes support and ask if they can remove the balance from your account : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
-
I received message: cannot download, select tools, download only and download manually (something like that). Please help, what does this mean?
Exactly what it says.
Do as the message says. -
Removing the excel rows automatically using VB script
Hi,
Can anyone please help me in functionality of, removing the excel rows automatically which are having value
as ZERO across all columns.Hi,
Please try the code:
Sub RemoveRows()
Dim i As Long
i = 1
Do While i <= ThisWorkbook.ActiveSheet.Range("A1").CurrentRegion.Rows.Count
If InStr(1, ThisWorkbook.ActiveSheet.Cells(i, 1).Text, "0", vbTextCompare) > 0 Then
ThisWorkbook.ActiveSheet.Cells(i, 1).EntireRow.Delete
Else
i = i + 1
End If
Loop
End Sub
PS:
This is the forum to discuss questions and feedback for Microsoft Excel, if you have further question about VBA code, please post the question to the MSDN forum for Excel
http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Regards,
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
I changed my ID Apple with another email, i received the confirmation, i changed my password and also received the confirmation but when i try to download something on my iPhone it still shows me my old email and nothing works ! ahhhhh what and how do i solve this ?
On your iPhone go to Settings > Store.
Select the Apple ID at the bottom.
Select Sign Out at the menu selection provided.
Follow this by signing in with your new Apple ID/iTunes store account.
All apps - all paid and free apps include DRM protection which is tied to the iTunes account that was used to download the apps. In order to install an app update for the apps downloaded with your previous Apple ID/iTunes account, you will need to use that account and password. -
My MacBook Air 13' (2013) will occasionally start the fan at full blast, not connect to any wifi or detect any wifi, and will remove the battery icon from my menu bad as well as tell me there is no battery connected. How do I fix this? I have restarted my computer multiple times, **** it down, and ran a diagnostic test to tell me nothing is wrong and my computer is not running any applications. There is no reason for the fan to be on full blast! when I try to set the option to show my battery icon in the menu bar, it will automatically uncheck. How do I fix all of this?
Have you tried SMC and PRAM resets?
http://support.apple.com/kb/HT3964
http://support.apple.com/kb/ht1379
Ciao. -
How do I retrieve my iTunes library from a broken computer onto another computer?? I've clicked on home sharing and also authorized the new computer to my account but still nothing!
It would help if you would describe what a 'broken' computer is. Did a truck run over it? Does it just not turn on? etc.
-
I have just bought Dell XPS15 Windows 8.1 office 2013. Cannot sync calender and contacts to Icloud and also not the Iphone 5 by cable
Try going through the troubleshooting steps listed under "Troubleshooting on Microsoft Windows (Microsoft Outlook)" in this article: http://support.apple.com/kb/TS3999. In particular, make sure the iCloud Outlook add-in is active within Outlook.
-
We have a DVD in the super drive on our Macbook Pro that will not eject. The DVD does not show up on the desktop. Have tried the keyboard eject button, and also restarting the computer. Any ideas on how to eject it?
here is a troubleshooting article from Apple about this: http://support.apple.com/kb/ht2801. Hope this helps
-
I have an iPod touch and also have the iHome.... When I first hooked it up it played music fine.....but now when I hook it up it says accessory unavailable for iPod touch and I've resetted it 2 times but still no music comes thru the iHome speakers
If you restored to factory settings/new iPod and still have the problem that indicates a hardware problem.
Make an appointment at the Genius Bar of an Apple store..
If your iPod is defective and not abused Apple will exchange it at no cost.
Apple Retail Store - Genius Bar
Maybe you are looking for
-
Manipulating java array object in an oracle procedure
hi there, i have a java store procedure that returns an array of filenames, and i have an oracle stored procedure that will for each filename returned in the java array object, open that file do some processing and load the data into database tables,
-
Reports 2.01 Variance Error
I have a report that uses accounts in the page dimension (with UDAs). When I use the variance function in a column formula I receive a cell error. Why?I have product in the rows & ,years & months in the columns I'm try to compare current month to pri
-
How can I change my database options after it's created ?
Hi , I'm using a 10 g oracle on a solaris 10 machine .I created a database and now I m willing to change the database option.I tried to use dbca but the Configuration Options checkbox is disabled.Is there any other way to change the database option ?
-
[SOLVED] Cannot install KDE with python-numpy pre-installed?
Hi, all I am with xfce currently and though of tring KDE. However when I tried to install KDE it turns that there are confilicts between 'kde' and 'python-numpy': :: Proceed with installation? [Y/n] (318/318) checking keys in keyring [##############
-
No sound Since I upgrade to 2.6.24-1
Since I run pacman -Syu a few days before, now my machine has no sound. Before I upgrade the whole system, everything goes well. After I upgrade the whole system, the sound doesn't work. Modules have loaded, alsamixer OK, but still no sound . my mach