0

I'm creating a database project for school using Oracle SQL Developer.

We have information that we need to retrieve from our databases, so I'm trying to write the queries to do this. For one of my queries, I am trying to rename my FROM clauses but am getting an error. I have tried putting the aliases in brackets, quotes, everything but I still get the error.

Can someone point out where I am going wrong with my syntax?

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

Ben
  • 51,770
  • 36
  • 127
  • 149
ACostea
  • 141
  • 2
  • 18
  • Ah, I see. It's not allowed in Oracle! Thanks Ben. I'll flag for admin to close. – ACostea Mar 24 '17 at 16:40
  • You should be able to agree with the potential duplicate ACostea and close it yourself. See: https://meta.stackexchange.com/q/250981/179419 – Ben Mar 24 '17 at 16:40
  • yup, if you put your mouse over the squiggly pink line on the AS, you'll see that we expect you to invoke the flashback query clause – thatjeffsmith Mar 24 '17 at 18:05

1 Answers1

0

Remove AS after table name in FROM clause.

table_name alias_name will do the job

Tom J Muthirenthi
  • 3,028
  • 7
  • 40
  • 60