tag:blogger.com,1999:blog-28828308.post9051932126616152915..comments2022-10-01T10:32:06.559+05:30Comments on Beyond Relational: XQuery Lab 1 - Transforming rows to columnsjacob.sebastianhttp://www.blogger.com/profile/16226852172321674933noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-28828308.post-86630091318037541332008-09-23T21:43:00.000+05:302008-09-23T21:43:00.000+05:30Thanks Thanks Thanks, it workssss,You're the Man:)...Thanks Thanks Thanks, it workssss,<BR/><BR/>You're the Man:)Hard to Imaginehttps://www.blogger.com/profile/08096229536280585809noreply@blogger.comtag:blogger.com,1999:blog-28828308.post-89555209029474795542008-09-23T21:26:00.000+05:302008-09-23T21:26:00.000+05:30Try this:DECLARE @x XMLSELECT @x = '< imove...Try this:<BR/><BR/>DECLARE @x XML<BR/>SELECT @x = '<BR/>< imovel ><BR/> < referencia >48428< /referencia ><BR/> < tipologia id="3"/ ><BR/> < para_venda / ><BR/>< /imovel >'<BR/><BR/>SELECT <BR/>x.value('referencia[1]','INT') AS referencia,<BR/>x.value('(tipologia/@id)[1]','INT') AS tipologia,<BR/>CASE<BR/> WHEN jacob.sebastianhttps://www.blogger.com/profile/16226852172321674933noreply@blogger.comtag:blogger.com,1999:blog-28828308.post-61196403145006276062008-09-23T21:19:00.000+05:302008-09-23T21:19:00.000+05:30hello again, and thanks for answer so quick...Lets...hello again, and thanks for answer so quick...<BR/><BR/>Lets see if my english can help my explanation :)<BR/><BR/>In the next example i want three columns, the first "Referencia" , the select returns the value i want, in the second "tipologia" the select return "null" (dont know why ), and in the third "para_venda", the select return zero to this column, Hard to Imaginehttps://www.blogger.com/profile/08096229536280585809noreply@blogger.comtag:blogger.com,1999:blog-28828308.post-25228624117520381682008-09-23T20:37:00.000+05:302008-09-23T20:37:00.000+05:30Sure, I can help you.What is the output that you a...Sure, I can help you.<BR/>What is the output that you are expecting from this SAMPLE xml document?jacob.sebastianhttps://www.blogger.com/profile/16226852172321674933noreply@blogger.comtag:blogger.com,1999:blog-28828308.post-27554269970742749652008-09-23T20:16:00.000+05:302008-09-23T20:16:00.000+05:30Hello, im new at xquery, so im little lost, my xml...Hello, im new at xquery, so im little lost, my xml file have a different structure... so i would love if u can give me a little help...<BR/><BR/>< imovel ><BR/> < referencia >48428< /referencia ><BR/> < tipo id="1" / ><BR/> < tipologia id="3" / ><BR/> < estado>NOVO< /estado ><BR/> < distrito id=&Hard to Imaginehttps://www.blogger.com/profile/08096229536280585809noreply@blogger.com