Join two Tables Without any Relations in SQ-Server 2008 R2

Join two Tables Without any Relations in SQL Server 2008 R2

Hello everyone, i am going to share the code sample how to join two tables without any relations in between as given below.

[ select row_number() over (order by RoleName) RowNum, tblrole.ID,tblrole.RoleName   
      from tblrole where tblrole.ClientId=" + SessionManager.CompanyId + " ),

                     OrderedBars as (select row_number() over (order by CountryName) RowNum, tblCountry.id,tblCountry.CountryName   from tblcountry (nolock))

   select f.ID,f.RoleName,u.id,u.CountryName from OrderedFoos f full outer join OrderedBars u on u.RowNum = f.RowNum ]





ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.