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 |
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-27 : 12:18:47
|
hi :DI got following code select (CONVERT(VARCHAR(50),boeken.uitg_id)+ CONVERT(VARCHAR(50),boeken.cat_id)) as BUitCaID, uitgever, titelfrom boekenleft join uitgeveron uitgever.uitg_id = boeken.uitg_id)select (CONVERT(VARCHAR(50),uitg_id) +CONVERT(VARCHAR(50),cat_id) )as UitCaID,uitgever.uitgever,categorie.categoriefrom categorie,uitgever Now, what i Need is to Combine the 2 querys with eachother.THe Id to join them is BUitCaID and UitCaID.Is that possible? |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2009-11-27 : 12:29:43
|
| convert both fields to "text" on the fly and then proceed.select (convert(cola, char(3)) + convert (colb, char(4)) from mytablei'm rushing home now, so play around with the syntax of the convert.... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-27 : 22:22:56
|
| [code]select *from(select (CONVERT(VARCHAR(50),boeken.uitg_id)+ CONVERT(VARCHAR(50),boeken.cat_id)) as BUitCaID, uitgever, titelfrom boekenleft join uitgeveron uitgever.uitg_id = boeken.uitg_id))t1join(select (CONVERT(VARCHAR(50),uitg_id) +CONVERT(VARCHAR(50),cat_id) )as UitCaID,uitgever.uitgever,categorie.categoriefrom categorie,uitgever )t2on t2.UitCaID=t1.BUitCaID[/code] |
 |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-28 : 05:24:24
|
| Hmm, I get incorrect syntax neer the )t1 and )t2,I tried also )as t1, but doesent work :) |
 |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-28 : 05:33:04
|
| Ow, found it, :) a ')' too much in select 1 ty :D |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-28 : 05:43:46
|
welcome |
 |
|
|
|
|
|
|
|