Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL inner join: ORA-00904: "Bonus.site_name": invalid identifier? Expand / Collapse
Author
Message
Posted Wednesday, May 1, 2013 6:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 2, 2013 10:16 AM
Points: 2, Visits: 2
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_name NVARCHAR2 200 - - No
sign_up_bouns NVARCHAR2 100 - - Yes
rake_back NUMBER 22 10 0 Yes
site_name NVARCHAR2 100 - - Yes

Poker Site
site_name NVARCHAR2 100 - - No
site_start DATE 7 - - No
coutry_origin VARCHAR2 70 - - Yes
Description VARCHAR2 500 - - Yes

Post #1448385
Posted Wednesday, May 1, 2013 7:39 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 5:28 AM
Points: 12,910, Visits: 32,013
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1448417
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse