Questions tagged [table-alias]

5 questions
2
votes
1 answer

(postgre)SQL how to disambiguate a name that could be a column name or a table alias

In PostgreSQL anyway you can pass a table (row) alias into a function and it will pass the entire record in. But when you have a table alias x and also a column name x, when you specify f(x) it will not know which one, throw error "ambiguous name x"…
Gunther Schadow
  • 523
  • 4
  • 10
2
votes
1 answer

Alias Names and Two Table Query Problems

I'm quite new to querying databases, I've only been doing it for about 2 weeks in the current job that I'm in and have never touched SQL prior to this. I'm working on trying to use alias names to pull two different sets of tables and display the…
SQLSavant
  • 209
  • 1
  • 2
  • 9
1
vote
2 answers

Table Aliases: MySQL says table R1 does not exist when Joining the same table 3 times

I have a table R with the following fields stated below: weatherID, dateRecorded, Days, locationID, timeRecorded, rainAmount, rainNumberHours, temperature, windSpeed, windDirection NB: The Days field is an integer type that describes the…
BenGik
  • 13
  • 3
0
votes
1 answer

Why can't I use a table alias in a subquery?

I have a MS Access database. When I try to run this query: SELECT * FROM ( SELECT * FROM tblClients AS a1 LEFT JOIN ( SELECT TOP 1 lVersion, lRequestID AS lVerReqId, lClientId FROM tblClientsVersionsHistory WHERE ID = ( …
John
  • 11
  • 1
0
votes
0 answers

Sql query is failing in Oracle DB

I run below query to fetch data from a Oracle DB - SELECT T1.Col1, T2.Col1 AS Tab2_Col1 FROM Tab1 AS T1 INNER JOIN Tab2 AS T2 ON Tab1.Col3 = Tab2.Col4 With that, I am getting below error - ORA-00933: SQL command not…
Bogaso
  • 101