one column (COLUMN_NAME) can't have two separate and distinct values.
I think you want an "or" not an "and" in the query
--- Ken Janusz <[EMAIL PROTECTED]> wrote:
> When I run this code both columns I get no rows returned. When I do
> a desc
> on one of the tables I see both columns. So, why
Change the "and" in your WHERE clause to an "or".
Kevin L. Bass
Database Administrator
Americal Corporation
-Original Message-
Sent: Tuesday, December 11, 2001 9:20 AM
To: Multiple recipients of list ORACLE-L
When I run this code both columns I get no rows returned. When I do a desc
funny, i run it in my database (mutatis mutandis for column names, natch)
and it works JUST FINE with AND.
buti am hoping an acknowledged SQL guru will step in and say this
-Original Message-
Change the 'and' to 'or'.
--
Please see the official ORACLE-L FAQ: h
I think you are confusing the logical and with the fact that you want
both columns. Try using or in place of and
(column_name = 'REGISTRATION_NUMBER' or
column_name = 'DOCUMENT_NUMBER')
Pat
>
> When I run this code both columns I get no rows returned. When I do a desc
>
You are trying to look for a column name be equal to two different names...
I assume you want an OR instead of the AND...
select table_name, column_name
from dba_tab_columns
where (column_name = 'REGISTRATION_NUMBER' OR column_name =
'DOCUMENT_NUMBER')
-Original Message-
Sent: Tuesday,
U - cause one row cannot have both values in the same column???
How about changing it to:
select table_name, column_name
from dba_tab_columns
where
(column_name = 'REGISTRATION_NUMBER' or
column_name = 'DOCUMENT_NUMBER')
or
where
(column_name in ('REGISTRATION_NUMBER','DOCUMENT_NUMBER'
I guess this is what you want:
select table_name, column_name
from dba_tab_columns
where (column_name = 'REGISTRATION_NUMBER' or column_name =
'DOCUMENT_NUMBER')
or
select table_name, column_name
from dba_tab_columns
where column_name in ('REGISTRATION_NUMBER', 'DOCUMENT_NUMBER')
-Origi
This was returned by the mailer-daemon because of a
locking problem ??
-Oorspronkelijk bericht-
Van: Jeroen van Sluisdam
Verzonden: dinsdag 11 december 2001 17:08
Aan: '[EMAIL PROTECTED]'
Onderwerp: RE: Why is this code not working?
You need an or-clause because one row
Change the 'and' to 'or'.
Ken Janusz wrote:
>
> When I run this code both columns I get no rows returned. When I do a desc
> on one of the tables I see both columns. So, why am I not getting any data?
>
> select table_name, column_name
> from dba_tab_columns
> where
> (column_name = 'REGISTR
When I run this code both columns I get no rows returned. When I do a desc
on one of the tables I see both columns. So, why am I not getting any data?
select table_name, column_name
from dba_tab_columns
where
(column_name = 'REGISTRATION_NUMBER' and
column_name = 'DOCUMENT_NUMBER')
Thanks,
K
10 matches
Mail list logo