Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9193

Re: How to check the two logic at a single statement for a particular filed in a table using 'WHERE' ?

$
0
0

Notwithstanding the other replies, you need to understand that with boolean logic, as used in most (all?) programming languages

 

*  WHERE stats  in ('P') and stats not in ('C')

*  WHERE STATS NE 'C' AND STATS EQ 'P'.

*  WHERE STATS EQ 'P' AND STATS NE 'C'.

*  WHERE STATS EQ 'P' AND STATS not LIKE 'C'.

*  WHERE stats = 'P' and ( stats <> 'C' and stats = 'P' ).

These five are logically identical to each other, and to "WHERE stats EQ 'P'"

 

*  WHERE STATS EQ 'P' or STATS ne 'C'.

Is logically equivalent to having no WHERE clause at all, as it is always true.

 

*  WHERE  stats NOT IN ('A', 'S', 'D', 'S', 'T', 'C').

will give you all records without these status. So 'P' will turn up.

 

But these are not return expected result.

That's because your expectations are incorrect, and you do not understand what you are doing.

 

You are failing to comprehend is how a select with a where clause works. All it does is go through each record in the table returning those records which ON THEIR OWN match the where clause.

 

This is foundationally basic ABAP programming. If you cannot get your head around this, then you are probably not suited to be a programmer. This site does not exist to teach people how to program.


Viewing all articles
Browse latest Browse all 9193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>