我将要完成以下的作业, 我有三个表格,分别是:
TblNation with fields: id_nation (key), first nation, second nation
TblAthlete with fields: id_athlete (key), name, surname
TblUnion with fields: id_nation (key), id_athlete(key)
我需要删除与特定姓氏对应的元组(假设姓氏字段没有冗余)。
我已经尝试过:
DELETE FROM TblNation INNER JOIN
TblUnion ON TblNation.id_Nation =
TblUnion.id_nation INNER JOIN
TblAthlete ON TblUnion.id_athlete = TblAthlete.id_athlete
WHERE TblAthlete.surname = 'something'
但是这段代码不起作用...有人可以帮助我吗?
ps. 我正在尝试在Microsoft SQL Server Management Studio中运行此查询。提前感谢。