Solved

filter big file based upon on multipe criteria

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Date and Time Conversion from Numeric Fields 21 273
AS400 Single Sign On 3 1,152
how to migrate the data from Db2 z/os to oracle data base 9 163
SQL400 max size 5 79
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

896 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

12 Experts available now in Live!

Get 1:1 Help Now