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.
| Author |
Topic |
|
d
Starting Member
26 Posts |
Posted - 2001-12-17 : 17:56:13
|
| I have a table called as A.It has 2 fields called course_code, course_code_group.e.g. course_code = 'A', course_code_group = 'ASD','ASDDF','ADEF','EFR'Now, I want to create a new table called as B with fields course_code, course_code_group.However, I want the values in the table to be as follows:course_code = 'A', course_code_group = 'ASD'course_code = 'A', course_code_group = 'ASDDF'course_code = 'A', course_code_group = 'ADEF'course_code = 'A', course_code_group = 'EFR'How can I do it?I really appreciate your help. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
d
Starting Member
26 Posts |
Posted - 2001-12-17 : 18:04:35
|
| Thanks a lot for your suggestion. I will look at the solution suggested by you.Also, the reason why I put it as a new topic was because I thought this was a different topic/question. However, next time I will continue on the same thread.Once again, thanks a lot. |
 |
|
|
d
Starting Member
26 Posts |
Posted - 2001-12-17 : 22:41:48
|
| Your suggestion was really great.I looked at the websites that you advised and found the required solution.I have another question.e.g. in the new table B,course_code = 'A', course_code_group = 'ALL'If 'ALL' is the value, then I want to have my final value look like as follows:select * from employeeThis means 'ALL' means no criteria to be used.However, if the values in the new table B is as follows:course_code = 'A', course_code_group = 'AAA'then I want to have my final value look likeselect * from employeewhere course_code_group in (select course_code_group from B where course_code = 'A')Is there a way that when I am writing my select statement, can I check if 'ALL' exists in the course_code_group value or not. If it does, then do not use course_code_group condition else use it???Please let me know your suggestion. |
 |
|
|
|
|
|
|
|