我想知道在我的 NFL SQL 数据库中运行了多少码。我使用以下查询:
Select season, description, down, ydsto1st
FROM nflpxp
WHERE
(
DESCRIPTION LIKE "%up the middle%"
OR DESCRIPTION REGEXP "(left|right) (tackle|guard|end)"
OR DESCRIPTION REGEXP " rushe(d|s) for "
)
AND season = 2012 AND off = 'WAS'
GROUP BY id
这返回
season description down ydsto1st
2012 (13:58) (Shotgun) R.Griffin right end to WAS 44 for 12 yards (S.Shanle). 2 10
2012 (11:23) A.Morris right tackle to NO 27 for 3 yards (C.Jordan). 1 10
2012 (10:44) (Shotgun) A.Morris right guard to NO 25 for 2 yards (S.Shanle; B.Bunkley). 2 7
2012 (8:30) (Shotgun) A.Morris right guard to NO 22 for 2 yards (W.Smith). 2 15
我想在我的查询中添加一列,从“for nn码”中提取码数
我试过了:
SELECT LEFT (description, LOCATE(' yards', description, 2)-1) AS yards FROM nflPxP
但它没有用。任何帮助表示赞赏。