Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have data in pivot structure in table. Below

Newspaper    Penang   KL    Sabah   Sarawak
The Star     10000    4800  5614    35247
The NST       8547    3257  8741     2354
The SUN       7125    23154 5792      100   


My question is How can I select Sabah and The Sun ? or Sabah,Sarawak and The NST ?
using sql command. Pls advice me.

Thank you
Posted

1 solution

1) Query for to select a Sabah and sun
select Newspaper from databasename where Sabah ='5792'

2) Query for to select Sabah ,Sarawak and the NST
select Newspaper,Sabah from databasename where Sarawak='2354'
 
Share this answer
 
v2
Comments
Maideen Abdul Kader 2-Jul-14 4:06am    
Hi Vani

I have given the small example.
for example I need to retrieve all data under Sabah whether match with newspaper i have selected or date i have selected.
There are lot data under sabah

Pls advise me.

Thank you
Maideen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900