table-alias

When to use SQL Table Alias

不想你离开。 提交于 2019-11-26 02:14:45
问题 I\'m curious to know how people are using table aliases. The other developers where I work always use table aliases, and always use the alias of a, b, c, etc. Here\'s an example: SELECT a.TripNum, b.SegmentNum, b.StopNum, b.ArrivalTime FROM Trip a, Segment b WHERE a.TripNum = b.TripNum I disagree with them, and think table aliases should be use more sparingly. I think they should be used when including the same table twice in a query, or when the table name is very long and using a shorter

How to use the 'as' keyword to alias a table in Oracle?

梦想与她 提交于 2019-11-26 02:02:49
问题 I\'m trying to execute this query in Oracle SQL Developer: SELECT G.Guest_ID, G.First_Name, G.Last_Name FROM Guest AS G JOIN Stay AS S ON G.Guest_ID = S.Guest_ID WHERE G.City = \'Miami\' AND S.Room = \'222\'; However, I get the following error: ORA-00933: SQL command not properly ended 00933. 00000 - \"SQL command not properly ended\" *Cause: *Action: Error at Line: 2 Column: 12 I don\'t see any problem in line 2 and the error is not very descriptive. It appears to be something to do with the