Questions tagged [alias]

Within a query, tables or subqueries may be aliased for readability and so that the same table can be referenced more than once in the query with different join conditions.

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
3answers
3k views

DB2: Database alias already exists when cataloging

SQL1005N The database alias "XYZ" already exists in either the local database directory or system database directory I am an accidental DB2 LUW on linux administrator; primary background in MSSQL ...
2
votes
1answer
928 views

ORDER BY clause with Alias

I am trying to get the sum of the market values for each given CPTY. Each CPTY can have several market values. In my output list, i want to see the top 5 CPTYs, ordered by the sum of their market ...
1
vote
0answers
100 views

Postgres - want a database to have two names

One of my Postgres databases is named entirely in upper-case, and a new bit of software needs to see it in lower-case. I've tried renaming it, but unfortunately that breaks the huge multitude of ...
0
votes
0answers
13 views

AlwaysOn Availability listener access issue

Good morning all , Who has any idea how to do create an SQL alias on a listen alwayson which uses a port other than 1433 thanks
0
votes
1answer
293 views

SQL Server Alias won't work for my database instance

I have setup a SQL Server 2019 instance on my machine which has a computer name in a format like this: AB-ABC1234ABAB My SQL instance is named 'SQL2019', therefore I connect to my local SQL instance ...
0
votes
1answer
41 views

Multiple vs Single COUNT on same col + Multiple vs Single col index

I have two very simple questions 1. Multiple vs Single COUNT on same col I need to perform CASE on an aggregate column like this: SELECT tbl_students.school, COUNT(tbl_students.id) as students, ( ...
0
votes
0answers
74 views

Linked server query fails when using an Alias after a schema change

Recently we added a new column [NewColumn] in a table [OurTable]. After that, a query from linked server referencing this table failed with error: The multi-part identifier "[OurTable].[NewColumn]"...
0
votes
1answer
25 views

Why do I get an error when filtering subSelect?

select "masters".*, (select avg (rating) from "reviews" where "master_id" = "masters"."id") as rating from "masters" where rating > 3 [42703] ERROR: column "rating" does not exist
0
votes
0answers
467 views

Is there any way to set the alias for command permanently in PostgreSQL?

I'm trying to set the alias for command permanently in PostgreSQL. I've set the alias for a command like given below. Test=> \set x '\\! reset' So, the alias has set for reset the terminal. While ...
0
votes
0answers
1k views

Is it possible to alias a column with a constant variable defined in the package header of a PL/SQL package?

I am trying to alias some columns that are being used to interface with a 3rd party data aggregation system. This company has stated that they might change their naming scheme in the near future, so I ...