Solved

filter big file based upon on multipe criteria

Posted on 2016-11-04
2
25 Views
Last Modified: 2016-11-06
Hi,
I have to filter based upon four columns emplid,empl_rcd,effdate ,seq filter is like 1000 rows in xls.


i can just do select can't create any tables etc.

i am doing

select * from tab
where org='PER'
or(emplid=1 and empl_rcd=2 and effdate='2016-01-01 and seq='1')
or(emplid=2 and empl_rcd=2 and effdate='2012-01-01 and seq='1')
and so on like 1000 times

I was wondering is there any easy or quick way to do it.

Thanks.
0
Comment
Question by:sam2929
2 Comments
 
LVL 18

Accepted Solution

by:
daveslash earned 500 total points
ID: 41874315
This is slightly easier:

select *
  from tab
 where org='PER'
    or (empl_rcd=2
   and  effdate='2016-01-01
   and  seq='1'
   and  emplid in (1,2,3,...))

Open in new window


HTH,
DaveSlash
0
 
LVL 27

Expert Comment

by:tliotta
ID: 41875030
@DaveSlash, Also note the different dates in the OP. One is 2016, but the other is 2012. Otherwise it might just be WHERE ... emplid BETWEEN 1 AND {some max value, e.g., 1000}, etc.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now