I have a table in db2 with these values and columns.
part location quantity
456 09B4 500
456 94C7 850
456 73B1 700
567 38A5 945
879 MR43F 1241
651 DC234 456
654 C34 546
456 B342 756
567 73B1 800
I need a sql statement for db2 that would be do this.
SELECT quantity FROM tablename WHERE part = '456'
AND ((first two digits of location are numeric) OR (location LIKE 'MR%')
I'm not sure how to go about doing this in db2. I need all the rows where part number is '456' and the first two characters of location are numeric and also the rows that start with 'MR'