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 |
|
goligol
Posting Yak Master
128 Posts |
Posted - 2011-06-30 : 12:06:01
|
| I want to have the following relationship:Could anyone help me to modify to code to get there:MV MD2 32 62 72 112 1213 1413 1513 1613 1713 18SELECT a.[MA] MV ,b.[MA] MDFROM [dev].[MA] a ,[dev].[MD] b(WHERE a.MA in ('2')and b.MA in ('3','6','7','11','12'))and(WHERE a.MA in ('13')and b.MA in ('14','15','16','17','18')) |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-06-30 : 12:20:46
|
| What is the result you are trying to get?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
goligol
Posting Yak Master
128 Posts |
Posted - 2011-06-30 : 12:21:46
|
| This is the results:MV MD2 32 62 72 112 1213 1413 1513 1613 1713 18 |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-06-30 : 12:26:06
|
| Very strange - this should give the result SELECT a.[MA] MV,b.[MA] MDFROM [dev].[MA] ajoin [dev].[MD] bWHERE (a.MA in ('2') and b.MA in ('3','6','7','11','12'))or (a.MA in ('13') and b.MA in ('14','15','16','17','18'))==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|
|
|