Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select specific field with query

Author  Topic 

RoyPaun
Starting Member

13 Posts

Posted - 2009-07-03 : 12:24:23
I am very new to SQL. My table has 16 fields. Tennis, Golf, etc. Using just one query how can I select one specific field by using a parameter. For example, I run the query and am able to enter "Golf"; the query then outputs the records in the Golf field. Next time I run the (same) query, I can enter "Tennis" and it will only output all the Tennis records. At the moment if I use 'SELECT [enter field name] FROM <tablename> AS Interest' and when the query is run I enter Golf in the parameter "enter field name", the query outputs the word Golf in every record, under the field heading Interest. Not exactly what I require !!!! Many thanks for any help.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-03 : 13:18:17
See http://www.datamodel.org/NormalizationRules.html


Microsoft SQL Server MVP

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

RoyPaun
Starting Member

13 Posts

Posted - 2009-07-03 : 13:55:26
Many thanks Peso. Entiendo !!!!
Go to Top of Page
   

- Advertisement -