SELECT the same column multiple times (SQL Server) -


Note : In the last time, I know it may sound like a stupid question, But I actually did it a little bit before posting here. It was one of those "right-down-your-nose" answers, oh!

I have tried to combine more than one simple lookup tables into one because I am told that common practice is common. I've combined the table with status and a priority level:

  Situation (ID, name) Projects (ID, Project Name, Status ID, Priority ID) - Master Table    for value 1-10  indicates my position while  indicates ID between <11> between ID ID  priority level if I select them in two tables If divided, they would be:  
  position (id) , StatusName) Priority (ID, Primary Name)   

Target

What I want to do, the results for these values ​​are called "Sets" As a master table joins, the result set is a query in two different columns. I tried the following questions, but it does not work:

  Name of the position, name as priority in the name of the project, name as priority by name Name in the left-hand position Street. StatusID = st.Name the external join position preferences p. Priority ID = PR Name.   

Sample results

  ProjectName | Position | Priority -------------------- | --------------- | ----------- Select Blueberry | On hold | Medium remodel bathroom. In progress | Low Plant Garden | In progress | High  

There are criteria for you to feel incorrect, as p.StatusID I can not imagine. Secondly, you must use your table aliases in your list:

  As the status name, select the project name, st.Name. Name the project as a primrty name. P. StattusID = Priority at St.PediaID = PRIID    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -