I’ve got an order items & a parts table, which i’m joining on the part ID foreign key:
SELECT orderID,qty,minorder
FROM
orderitem
LEFT JOIN
parts
ON orderitem.partID=parts.partID
WHERE orderitem.orderID='2128' AND qty < minorder
When i perform this query, i am getting no results. When i remove the qty < minorder from the where clause, i get the following.
I’m’ trying to craft this query so i get the 2nd record (where the qty is less than the minorder).
Any ideas?
In my comment above, if your data types are strings, just add this to your query…
By adding a numeric to a string, it will implicitly convert to number and perform the expected comparison.