troubleshooting Question

How to take out inconsistant values in SQL

Avatar of williamwlk
williamwlk asked on
Oracle DatabaseSQL
9 Comments3 Solutions516 ViewsLast Modified:
[STAB]

SNAME      STYPE      SKEY      SVAL
service-001      web      KEY1      1000
service-001      web      KEY2      2000
service-001      web      KEY3      3000
service-001      web      KEY4      4000
service-002      web      KEY1      2000
service-002      web      KEY2      1000
service-002      web      KEY3      3000
service-002      web      KEY4      4000
service-003      web      KEY1      1000
service-003      web      KEY2      2000
service-003      web      KEY3      1000
service-003      web      KEY4      2000
service-004      web      KEY1      4000
service-004      web      KEY2      2000
service-004      web      KEY3      3000
service-004      web      KEY4      5000
service-005      web      KEY1      1000
service-005      web      KEY2      2000
service-005      web      KEY3      3000
service-005      web      KEY4      4000


i'd like to know how I can get the inconsitant SVAL for the SKEY using SQL.

Here is the expected result:

service-002      web      KEY1      2000
service-002      web      KEY2      1000
service-003      web      KEY3      1000
service-003      web      KEY4      2000
service-004      web      KEY1      4000
service-004      web      KEY4      5000

In Excel, I created a new column concatenating SKEY+SVAL and I remove duplicates on that column. And then, I leave out the first consistent set [of service-001]. And I got the above expected result.

Thanks and regards,
W
ASKER CERTIFIED SOLUTION
Christoffer Swanström
Partner

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros