Solved

filter big file based upon on multipe criteria

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AS400 DB2 to MS SQL Server 2012 4 1,440
SAS Email Chart as attachment code 2 296
How would you as a DBA (DB2) answer this question? 9 85
iBM i DB2 Administration Training 6 107
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…
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…

839 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