SELECT AcId, AcName, PldepPer, RepId, CustCatg, HardCode, BlockCust, CrPeriod, CrLimit, BillLimit, Mode, PNotes, gtab82.memno FROM VCustomer AS v1 INNER JOIN gtab82 ON gtab82.memacid = v1.AcId WHERE (AcGrCode = '204' OR CreDebt = 'True') AND Masked = 'false' ORDER BY AcName
You typically only use an alias for a table name when you need to prefix a column with the table name due to duplicate column names in the joined tables and the table name is long or when the table is joined to itself. In your case you use an alias for VCustomer
but only use it in the ON
clause for uncertain reasons. You may want to review that aspect of your code.
Related Posts:
- Insert text with single quotes in PostgreSQL
- ERROR: there is no unique constraint matching given keys for referenced table “bar”
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- Postgresql tables exists, but getting “relation does not exist” when querying
- postgresql: error duplicate key value violates unique constraint
- pg_ctl: no database directory specified and environment variable PGDATA unset
- Postgres Error: More than one row returned by a subquery used as an expression
- What is the difference between LATERAL JOIN and a subquery in PostgreSQL?
- PostgreSQL create table if not exists
- updating table rows in postgres using subquery
- PostgreSQL visual interface similar to phpMyAdmin?
- GROUP BY and COUNT using ActiveRecord
- Postgresql column reference “id” is ambiguous
- What is a postgres superuser
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- SQL WITH clause example [duplicate]
- The wait operation timed out. ASP
- SQL query to select dates between two dates
- MySQL – Operand should contain 1 column(s)
- SQL SELECT WHERE field contains words
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- NOT IN vs NOT EXISTS
- Must declare the scalar variable
- ORA-00979 not a group by expression
- How can I do a FULL OUTER JOIN in MySQL?
- MySQL query String contains
- Finding duplicate values in a SQL table
- MySQL Cannot Add Foreign Key Constraint
- Oracle error : ORA-00905: Missing keyword
- How do I import an SQL file using the command line in MySQL?
- mysql Foreign key constraint is incorrectly formed error
- Can a foreign key be NULL and/or duplicate?
- How do composite indexes work?
- Difference between JOIN and INNER JOIN
- MySQL “WITH” clause
- What is the difference between JOIN and UNION?
- MySQL Multiple Joins in one query?
- Error Code: 2013. Lost connection to MySQL server during query
- “CASE” statement within “WHERE” clause in SQL Server 2008
- SQL join on multiple columns in same tables
- ORA-00972 identifier is too long alias column name
- What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?
- Sql query – getting rid of hard-coded values
- ORA-00918: column ambiguously defined in SELECT *
- How To Run A Github Repository?
- SQL Switch/Case in ‘where’ clause
- Oracle – ORA-01489: result of string concatenation is too long [duplicate]
- SQL Server WITH statement
- “ORA-01438: value larger than specified precision allowed for this column” when inserting 3
- Algebra Relational sql GROUP BY SORT BY ORDER BY
- Oracle “Partition By” Keyword
- What is the equivalent of ‘describe table’ in SQL Server?
- Add a column with a default value to an existing table in SQL Server
- Cannot simply use PostgreSQL table name (“relation does not exist”)
- Cast from VARCHAR to INT – MySQL
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]
- Using group by on multiple columns
- What is the purpose of using WHERE 1=1 in SQL statements?
- Conversion failed when converting the varchar value ‘simple, ‘ to data type int
- Is there a workaround for ORA-01795: maximum number of expressions in a list is 1000 error?
- How do you force mysql LIKE to be case sensitive?
- What is the difference between a stored procedure and a view?
- Bulk load data conversion error (truncation)
- Insert into a MySQL table or update if exists
- Convert timestamp to date in Oracle SQL
- How to order by with union in SQL?
- Update statement with inner join on Oracle
- Incorrect syntax near ”
- MySQL: Can’t create table (errno: 150)
- Join vs. sub-query
- Alternative to except in MySQL
- DATEDIFF function in Oracle
- MySQL – Get row number on select
- What does * mean in sql?
- How to truncate the text returned for a column in a MySQL query
- INSERT VALUES WHERE NOT EXISTS
- Using union and order by clause in mysql
- Difference between `load data inpath ` and `location` in hive?
- How to implement LIMIT with SQL Server? [duplicate]
- How To Write An Inner Join With WP Query
- Update user_login, user_nicename, and display_name
- Change sticky status of posts from phpMyAdmin
- Fetch all Posts where logged in user has commented
- Needing to move content from postmeta to posts in sql [closed]
- How to import a Typo3 database to a wordpress site?
- What does the $posts_join filter join to?
- Clean up very big and very dirty database
- How to delete ALL comments from certain category in WordPress database?
- How can I convert everything from category X to have post format Link
- Bulk delete WordPress Post and all metadata, etc using SQL query
- What steps do I need to take to install a local copy of a live website?
- Reset post IDs with all post meta
- How to Add or Change Post Title
- Why does DROP TABLE-ing the `wp_options` reset my user session?
- How to refactor DB queries for better TTFB in WordPress?
- query sql-table and change entities
- Analog category_and (WP) in sql query
- Backtick (MySQL norm) added to SQL Server Query causing error
- GRANT SELECT to all tables in postgresql