Solved

filter big file based upon on multipe criteria

Posted on 2016-11-04
2
75 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 (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

713 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