Corelation names (renamed fields or files) can only be used outside the
current SUB-Select.
A Sub-Select can consist of:
SELECT
FROM
WHERE
GROUP BY
HAVING
Order By is outside the sub-select, that's why correlation names are allowed
within the order by clause, while they are not allowed in group by clauses.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Gqcy
Gesendet: Monday, 08. November 2010 17:02
An: midrange-l@xxxxxxxxxxxx
Betreff: SQL question - why doesn't WHERE clause know about renamed fields?
SELECT
polog.poendt as day_entered,
ech.hedte as day_ordered
FROM xyzlib/pologpf AS polog
JOIN xyzlib/ech AS ech
ON polog.pokord = ech.hord
where day_entered > day_ordered
Column DAY_ENTERED not in specified tables.
Is this just part of SQL, or am I missing something???
These are dates, and I have created a UDF to convert numeric
to Date(not shown in above example), but I can't use the renamed fields...
thanks
Gerald
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: SQL question - why doesn't WHERE clause know about renamed fields?, (continued)
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.