使用" as"给FROM子句一个别名在Oracle中

时间:2017-03-24 16:30:43

标签: sql oracle

我正在使用Oracle SQL Developer为学校创建数据库项目。

我们需要从数据库中检索信息,因此我尝试编写查询来执行此操作。对于我的一个查询,我正在尝试重命名我的FROM子句但是收到错误。我已经尝试将别名放在括号,引号,一切,但我仍然得到错误。

有人可以指出我的语法错误吗?

SELECT AvatarName AS "MegaAvName", SpeciesName AS "MegaAvSpecies", MagicName 
AS "MegaAvMagic", Hoard,
AvatarName AS "Father", SpeciesName AS "FatherSpecies", SpeciesCost AS 
"FatherSpeciesCost", WisdomName AS "FatherWisdom",
AvatarName AS "Mother", SpeciesName AS "MotherSpecies", SpeciesCost AS 
"MotherSpeciesCost", WisdomName AS "MotherWisdom"

FROM MegaAvatar AS MA, Avatar AS A, Species AS MSP, MagicPower AS MP, 
SuperAvatar AS FSA, Avatar AS FA, Species AS FSP, Wisdom AS FW,
SuperAvatar AS MSA, Avatar AS MA, Species AS MSP, Wisdom AS MW

WHERE MA.Avatar_ID=A.AvatarID AND Avatar.SpeciesID=MSP.SpeciesName AND 
MegaAvatar.MagicPowerID=MP.MagicPowerID AND A.Hoard>='16'
AND MegaAvatar.PrimParentID=FSA.SuperAvID AND FSA.AvatarID=FA.AvatarID AND 
FA.SpeciesID=FSP.SpeciesID
AND MegaAvatar.SecParentID=MSA.SuperAvID AND MSA.AvatarID=MA.AvatarID AND 
MA.SpeciesID=MSP.SpeciesID;

Error

1 个答案:

答案 0 :(得分:0)

AS子句中的表名后删除FROM

table_name alias_name将完成这项工作