sql IPL中最年轻的外国球员

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql IPL中最年轻的外国球员相关的知识,希望对你有一定的参考价值。

-- Youngest Foreign players in IPL

WITH Debut ( Player_Name , Debut_Match) As
(
	SELECT C.Player_Name , MIN(A.Match_Date) As 'Debut_Match'			
					FROM Match A
						INNER JOIN Player_Match B
							ON A.Match_Id = B.Match_Id
						INNER JOIN Player C
							ON B.Player_Id = C.Player_Id
						WHERE C.Country_Name <> 1 AND C.Player_Id <> 179
						GROUP BY C.Player_Name
)

SELECT  Debut.Player_Name , DATEDIFF(day, Player.DOB , Debut.Debut_Match)/365 As 'Years' ,
							DATEDIFF(day, Player.DOB , Debut.Debut_Match) - (DATEDIFF(day, Player.DOB , Debut.Debut_Match)/365)*365  As 'Days' 
	FROM Debut 
				INNER JOIN Player
					ON Debut.Player_Name = Player.Player_Name 
				ORDER BY Years , 'Days' ASC;
        
        
-- Linkedin Profile :  https://www.linkedin.com/in/harshasannareddy/

以上是关于sql IPL中最年轻的外国球员的主要内容,如果未能解决你的问题,请参考以下文章

sql IPL中为大多数球队效力的球员(2008年 - 2016年)

sql IPL中最多五个检票口的投球手(2008-2016)

sql 印度超级联赛数据库中排名前十的最年轻球员

sql 印度超级联赛数据库中排名前十的最年轻球员

sql 每个团队参加的IPL季节数量

sql 每个团队参加的IPL季节数量