Solved

check 15 fields in Oracle table = '15'  - SQL

Posted on 2014-03-24
2
351 Views
Last Modified: 2014-03-24
Experts,

I would like to know if there is a way to check msgno1 - msgn015 to see if any have a value of equal to '15' and use this is a selection criteria in a where statement if Oracle SQL.

If anyone of the respective 15 fields has a value of '15', I want to select the record if not I don't.
0
Comment
Question by:morinia
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 39950810
SELECT *
  FROM yourtable
 WHERE '15' IN (msgno1,
                msgno2,
                msgno3,
                msgno4,
                msgno5,
                msgno6,
                msgno7,
                msgno8,
                msgno9,
                msgno10,
                msgno11,
                msgno12,
                msgno13,
                msgno14,
                msgno15)
0
 
LVL 33

Expert Comment

by:ste5an
ID: 39950826
Normalize your table?
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

Suggested Solutions

Title # Comments Views Activity
sql calculate averages 18 47
Web Service from a stored procdure oracle 10 49
SQL Statement to Update Email Domain 2 21
Extract string portion 2 14
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

920 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

16 Experts available now in Live!

Get 1:1 Help Now