|
-
Apr 22nd, 2008, 03:20 PM
#1
Thread Starter
Registered User
[RESOLVED] Oracle 9i: Alias in WHERE clause
So, it appears that I can't use an Alias in a WHERE clause with Oracle 9i? ORA-00904:"SELLOFFDATE":Invalid Identifier is the error.
If that is the case, how shall I perform the comparison in my WHERE clause below? If I'm simply making some SQL error, let me know that too. 
Here's a snippet of what I'd like to do. Thanks for any help!
sql Code:
select
(select to_date(r2.FIELD_VALUE, 'dd-mon-yyyy')
from V_REPCUSTOMFIELDDATA r2
where
r2.INTERNAL_DESCRIPTIONS_CODE = 35
and r2.ASSOCIATED_WITH_CODE = ag.AGREEMENTS_ABBR) SellOffDate,
ag.AGREEMENTS_ABBR LicensorNumber
from V_AGREEMENT ag
where SellOffDate between
to_date('01/01/1999', 'mm/dd/yyyy') and to_date('12/31/2001', 'mm/dd/yyyy')
-
Apr 23rd, 2008, 02:51 AM
#2
Lively Member
Re: Oracle 9i: Alias in WHERE clause
you can put your where condition in your subquery
Code:
SELECT
(SELECT to_date(r2.FIELD_VALUE, 'dd-mon-yyyy')
FROM V_REPCUSTOMFIELDDATA r2
WHERE
r2.INTERNAL_DESCRIPTIONS_CODE = 35
AND r2.ASSOCIATED_WITH_CODE = ag.AGREEMENTS_ABBR
AND to_date(r2.FIELD_VALUE, 'dd-mon-yyyy') BETWEEN
to_date('01/01/1999', 'mm/dd/yyyy') AND to_date('12/31/2001', 'mm/dd/yyyy') ) SellOffDate,
ag.AGREEMENTS_ABBR LicensorNumber
FROM V_AGREEMENT ag
-
Apr 23rd, 2008, 08:36 AM
#3
Thread Starter
Registered User
Re: Oracle 9i: Alias in WHERE clause
Easy enough. That seems to work! Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|