By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,469 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,469 IT Pros & Developers. It's quick & easy.

Retrieval of information from table based on column name and values in column

P: 1
I am trying to retrieve information from a table based on a column name (ex. 6187A1) and the I only want to retrieve the information from that column that has a value of "1". I will use this information to find me only the "Comp" that is required.

(Comp) (6187A1) (6187A2)
(BZ401) (1) (1)
(C1) (1) (1)
(C101) (0) (0)
(C11) (1) (1)
(C13) (1) (1)
(C168) (0) (0)
(C17) (1) (1)
(C201) (1) (1)
(C202) (1) (1)
(C205) (0) (0)
(C210) (1) (1)
(C211) (0) (0)
Apr 16 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,315
You need to learn basic SQL
Expand|Select|Wrap|Line Numbers
  1. SELECT [Comp]
  2. FROM tableName
  3. WHERE [6187A1] = 1
Also, it looks like your data is not normalized.
Apr 16 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.