Solved

filter big file based upon on multipe criteria

Posted on 2016-11-04
2
60 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 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