Solved

sql server query

Posted on 2016-08-02
3
53 Views
Last Modified: 2016-08-02
I have a table with chords and scale types. I would like to choose a chord for this explanation a "cmin" and return the rows where cmin appears in anyof the columns from 1 to dim7
not sure how to do that


here's example data

ID      ScaleType      i      ii      iii      iv      v      vi      vii      Dim7      Tonic      GridLength
1      Major      C maj      D min      E min      F maj      G maj      A min      B dim      -      C      7
2      Minor      C min      D min      D# maj      F min      G min      G# maj      A# maj      -      C      7
3      Dorian      C min      D min      D# maj      F maj      G min      A dim      A# maj      -      C      7
4      Mixolydian      C maj      D min      E dim      F maj      G min      A min      A# maj      -      C      7
5      Lydian      C maj      D maj      E min      F# dim      G maj      A min      B min      -      C      7
6      Phrygian      C min      C# maj      D# maj      F min      G dim      G# maj      A# min      -      C      7
7      Locrian      C dim      C# maj      D# min      F min      F# maj      G# maj      A# min      -      C      7
8      Diminished      C dim      C# dim      D# dim      E dim      F# dim      G dim      A dim      A# dim      C      8
9      Whole-half      C dim      D dim      D# dim      F dim      F# dim      G# dim      A dim      B dim      C      8
10      Whole Tone      C aug      D aug      E aug      F# aug      G# aug      A# aug      -      -      C      6
11      Minor Blues      C sus      D# min      F sus2      D# min      F sus2      D# min      -      -      C      6
12      Minor Pentatonic      A# sus2      C min      D# sus2      F sus2      D# maj      -      -      -      C      5
13      Major Pentatonic      A min      C sus2      D sus2      C maj      G sus2      -      -      -      C      5
14      Harmonic Minor      C min      D dim      D# Aug      F min      G maj      G# maj      B dim      -      C      7
ee.JPG
0
Comment
Question by:PeterBaileyUk
[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
3 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 41738810
declare @search as varchar = 'c min'

select
*
from that_table
where  i   = @search
or   ii     =@search
or  iii     = @search
or iv     = @search
or v      = @search
or vi        = @search
or vii        = @search
or Dim7   = @search
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 41738817
thank you
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 41738820
a pleasure, thank you
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

696 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