SQL inner join: ORA-00904: "Bonus.site_name": invalid identifier?

  • SELECT *

    FROM "Poker_Site" INNER JOIN "Bonus"

    ON "Poker_Site.site_name" = "Bonus.site_name";

    Whats wrong with this select query/ I have tried removing the quotes.

    Bonus

    bonus_nameNVARCHAR2200 - -No

    sign_up_bounsNVARCHAR2100 - -Yes

    rake_backNUMBER22100Yes

    site_nameNVARCHAR2100 - -Yes

    Poker Site

    site_nameNVARCHAR2100 - -No

    site_startDATE7 - -No

    coutry_originVARCHAR270 - -Yes

    DescriptionVARCHAR2500 - -Yes

  • In Oracle, Each Object can have double quotes. that means the table can have quotes, and it's column names can have quotes...but you can't wrap them all in-one..they each get their own.

    so "Bonus"."site_name" is correct, but "Bonus.site_name" is not...it implies a single object that happens to have a period in it's name.

    --Oracle

    SELECT *

    FROM "Poker_Site" INNER JOIN "Bonus"

    ON "Poker_Site"."site_name" = "Bonus"."site_name";

    --SQL equivilent

    SELECT *

    FROM [Poker_Site] INNER JOIN [Bonus]

    ON [Poker_Site].[site_name] = [Bonus].[site_name];

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply