. Advertisement .
..3..
. Advertisement .
..4..
As advised, I used some code samples in another forum, but it could not improve the problem. My question is the “missing from-clause entry for table” in sql-how to solve it? The command line is:
SELECT
AcId, AcName, PldepPer, RepId, CustCatg, HardCode, BlockCust, CrPeriod, CrLimit,
BillLimit, Mode, PNotes, gtab82.memno
FROM
VCustomer
INNER JOIN
vcustomer AS v1 ON gtab82.memacid = v1.acid
WHERE (AcGrCode = '204' OR CreDebt = 'True')
AND Masked = 'false'
ORDER BY AcName
and the result:
missing FROM-clause entry for table "gtab82"
What does the message mean? Can you advise me to fix it? If you have other better answers, leave them in the answer box below.
The cause:
This error happens because your FROM or JOIN clauses do not include the gtab82 table. Another reason is that an alias name is used for a table but the WHERE clause does not include it.
Solution:
Only when you need to prefix a column with the table name because there are duplicate column names in the connected tables and the table name is large or when the table is joined to itself should you use an alias for the table name. In your situation, VCustomer has an alias, but you only use it in the ON clause for unknown reasons. You had better check that section of your code.
Because the gtab82 table doesn’t belong in your FROM clause or JOIN. These cases refer to the gtab82 tables: gtab82.memno, gtab82.memacid