‎2014 Jan 22 12:32 PM
Hey guys,
is there a way to build ONE select statement where the logic expressions compares two fields of the database table?
e.g.:
select * from TABLE
where FIELD_1 <> FIELD_2.
thx, M.
‎2014 Jan 22 12:41 PM
Hi,
You need use the operator 'AND' ??
Do you mean that?
select * from mara
where matnr <> matkl
AND loekz <> 'X'.
Regards
‎2014 Jan 22 12:46 PM
both fields are fields in the table. I want to select those entries, which have different entries in the fields.
‎2014 Jan 22 12:57 PM
It is a weird query. I am sure that exist another way to solve your problem...
Regards,
‎2014 Jan 22 12:50 PM
hi,
you mean two fields of the same table.
if that is the case , then you cannot do it.
Reason , in where clause u cannot compare two fields of the same table.
regards,
‎2014 Jan 22 12:52 PM
You have to "qualify" the second fields,
Read documentation of WHERE - sql_cond in online SELECT statement documentation.
Regards,
Raymond
‎2014 Jan 22 1:25 PM
‎2014 Jan 22 1:42 PM
Hi All,
Im sorry for my reply, raymond and philip are right , yes it works.
regards.