How do I list all the available options for a column in sql
Say, the field "Expertise" contains available options "Accounting", "Language", "Engineering" and so on. How do I list all the available options for the field "Expertise" in ms sql 2014? Pls help.
July 31st, 2015 3:45am

Hello,

Not very clear; do you mean to get a list of all unique values of the existing data? If so, then try

SELECT DISTINCT Expertise
FROM yourTable

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 8:01am

If you just want the values in the Expertise column.

Then you can use

SELECT Expertise FROM TableName  

this is in case you don't have duplicate values for the column

OR 

this is in case you  have duduplicate values for the column

SELECT DISTINCT Expertise FROM TableName

July 31st, 2015 8:23am

Columns are not fields; that was punch cards and magnetic tape files. One of the many ways is that a column can hold only scalar values. In RDBMS, we use a relationship and normalization. The idiom looks like this: 

CREATE TABLE Personnel 
(emp_id CHAR(10) NOT NULL PRIMARY KEY,
 ..);

CREATE TABLE Job_Skills
(emp_id CHAR(10) NOT NULL
  REFERENCES Personnel (emp_id)
  ON DELETE CASCADE,
 expertise_name VARCHAR(15) NOT NULL,
 PRIMARY KEY (emp_id, expertise_name),
 ..); 

You might also want to look up industry standard codes for job titles and skills. Start with the old DOT (Dictionary of Occupational Titles). 

 
Free Windows Admin Tool Kit Click here and download it now
August 1st, 2015 4:06pm

available options? So do you mean Expertise is a parameter or something?
August 2nd, 2015 2:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics