tag:blogger.com,1999:blog-6082652835152798567.post5116844628056865491..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Difference between cube and rollup in SQL ServerUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-6082652835152798567.post-2494607169219285482024-01-04T20:36:49.270-08:002024-01-04T20:36:49.270-08:00WE can use LeftJoin
select A.Team_Name,B.Team_Name...WE can use LeftJoin<br />select A.Team_Name,B.Team_Name from Team A Leftjoin Team B on A.Team_Name = B.Team_NameAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-59328489752784965462016-06-13T04:40:31.064-07:002016-06-13T04:40:31.064-07:00Hi Bhaskar,
We just need to do small change in Gau...Hi Bhaskar,<br />We just need to do small change in Gautham's solution to get the desired solution.<br />Please refer to my solution.<br /><br />Select ROW_NUMBER() OVER(ORDER BY B.Id) AS 'MatchNo.', LEFT(B.TeamName, 3) AS 'Team A', LEFT(A.TeamName, 3) AS 'Team B' <br /> from #Teams A Cross Join #Teams B --WHERE A.ID <> B.Id --AND B.Id <> A.Id<br /> where b.id < a.IdDurga Prasadhttps://www.blogger.com/profile/10795027256719348207noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-51837733652290206372015-09-28T01:49:50.425-07:002015-09-28T01:49:50.425-07:00Hi Gautam,
Thanks for your reply, But each tea...Hi Gautam,<br /><br /> Thanks for your reply, But each team will play with other team only once. It's kind of knockout tournament.<br /><br />Thanks<br />Baskar M<br /><br />Anonymoushttps://www.blogger.com/profile/02218933092099487404noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-80000131484491381992015-09-26T04:47:55.551-07:002015-09-26T04:47:55.551-07:00Create Table Teams
(
Id Int,
TeamName NVARCHAR(1...Create Table Teams<br />(<br /> Id Int,<br /> TeamName NVARCHAR(100)<br />)<br />Insert Into Teams Values(1,'INDIA')<br />Insert Into Teams Values(2,'PAKISTAN')<br />Insert Into Teams Values(3,'AUSTRALIA')<br />Insert Into Teams Values(4,'SOUTH AFRICA')<br />Insert Into Teams Values(5,'NEW ZEALAND')<br /><br />Select ROW_NUMBER() OVER(ORDER BY B.Id) AS 'MatchNo.', LEFT(B.TeamName, 3) AS 'Team A', LEFT(A.TeamName, 3) AS 'Team B' from Teams A Cross Join Teams B WHERE A.ID <> B.Id<br /><br />If you want data in result like SA, NZ then your should use team code(County code) column as well in the table<br /><br />Regards,<br />Gautam <br />7411885591Anonymoushttps://www.blogger.com/profile/09363294298735720361noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-72298738900677723542015-09-24T22:57:21.562-07:002015-09-24T22:57:21.562-07:00Hi Venkat,
How to create a tournament fixture w...Hi Venkat,<br /><br /> How to create a tournament fixture with the following table.<br /><br />TEAM <br />ID TEAM_NAME<br />1 INDIA<br />2 PAKISTAN<br />3 AUSTRALIA<br />4 SOUTH AFRICA<br />5 NEW ZEALAND<br /><br />I need output to be like this.<br /><br />Tournament Fixture <br />MATCH NO TEAM A TEAM B<br />1 IND PAK<br />2 IND AUS<br />3 IND SA<br />4 IND NZ<br />5 PAK AUS<br />6 PAK SA<br />7 PAK NZ<br />8 AUS SA<br />9 AUS NZ<br />10 SA NZ<br /><br />Anonymoushttps://www.blogger.com/profile/02218933092099487404noreply@blogger.com