Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-03-24
2
Medium Priority
?
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 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 35

Expert Comment

by:ste5an
ID: 39950826
Normalize your table?
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

618 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