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 |
under2811
Constraint Violating Yak Guru
366 Posts |
Posted - 2006-09-11 : 01:43:23
|
hello friends!!I have Priority_tst table and product_tst table..create table Priority_tst (id int,status varchar(10))insert into Priority_tst (id,statu) values(1,'High')insert into Priority_tst (id,status) values(2,'Low')insert into Priority_tst (id,status) values(3,'Medium')and create table Product_tst (pid int,pnme varchar(5),statusid varchar(10))insert into Product_tst (pid,pnme,statusid) values(1,'Sugar','1,2')insert into Product_tst (pid,pnme,statusid) values(2,Milk,'2,3')i want join with this two tables and return values in tearms of High , Low , Medium likeselect M.pid,M.pnme,N.status from Product_tst M join Priority_tst Non....... where M.pid = 1output likepid pnme status1 Sugar High1 Sugar LowT.I.A |
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-11 : 02:33:39
|
Drop the statusid column from product_tst table and create a new table with two columns:priority_tst table:ProductID INTPriorityID INTDATA IN priority_tst table1 11 22 22 3Peter LarssonHelsingborg, Sweden |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|