473,378 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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
1 1195
Rabbit
12,516 Expert Mod 8TB
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

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

Similar topics

1
by: hjyn | last post by:
Hi All, I create a form for the user to enter the information, the form contains two table, table A and table B. I wrote a script to prompt the user to fill all the necessary data if they miss to...
2
by: Norman Leung | last post by:
Hi all Would there be a easy way to find the column name(s) which constitute a Primary constraint for a table through navigating the system catalogs. I found that the PK Constraint object in...
4
by: mokles | last post by:
Hi All, I am trying to change column name on an existing table. I am using SQL Server 7. As the table is quite big, it is taking quite long time to do it. By the way I could change the column...
0
by: EKL | last post by:
Hi, I'm making a sort of Customer and Orders database in MS Access 2003. My problem is that I wish to update the table "tblTransaction" based on changes made in the table "tblOrderDetails"....
1
by: nate axtell | last post by:
In VB .NET I load the contents of an Excel or comma seperated values file into a dataGrid (via a datatable). One of the columns has a comma in the name of the column. So for the comma separated...
4
by: Ying Lu | last post by:
Hello, Under mysql, we have "desc tablename" to get the detail information about a table. My question is about to get column name, and column type for a specific table under PostgreSQL through...
1
by: sgCool | last post by:
My data is like Below: id abc def ---- --------- ------------------------------ 1 1.584795 2006-11-04 13:36:06.0 2 1.584795 2006-11-04...
1
by: dmeyr | last post by:
Hello, I am new to Access and am having difficulty with a Dlookup function. I have a form that I wish to autopopulate 10 fields with values based on two criteria which are also fields on the form....
3
ChaseCox
by: ChaseCox | last post by:
I have two tables, one is my main table(main), containing all of the information about the product, including the 3 digit code in question. The other table (small) contains only one column of the 3...
1
by: abinesh.agarwal | last post by:
Hi , I want to update the column in a table based on the updation of the other column in the same table, but not getting the desired result. DDL: CREATE TABLE .( NULL,
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.