Solved

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

Posted on 2014-03-24
2
348 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
Comment Utility
SELECT *
  FROM yourtable
 WHERE '15' IN (msgno1,
                msgno2,
                msgno3,
                msgno4,
                msgno5,
                msgno6,
                msgno7,
                msgno8,
                msgno9,
                msgno10,
                msgno11,
                msgno12,
                msgno13,
                msgno14,
                msgno15)
0
 
LVL 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
Normalize your table?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to take different types of Oracle backups using RMAN.

771 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

10 Experts available now in Live!

Get 1:1 Help Now