table inner join not displaying expected results

18
April 16, 2019, at 00:00 AM

I am trying to get a query to display some results. I double checked the logic to make sure that it is correct and it looks like it should work to me but does not.

I created a query with the logic I need to use, code is at the bottom.

SELECT * FROM vendor v
-- select table
inner join product p
-- join second table
on v.V_CODE = p.V_CODE
-- link table
where p.P_QOH <= p.P_MIN;
-- filter products where product quantity on hand is less than or equal to product minimum count
-- TODO: Get results to actually display

Expected results are: a list of products where the product quantity on hand is less than or equal to the minimum quantity.

Actual results: No products return, its empty.

This is what my table looks like: table

Answer 1

From what I can see on your table, the condition is never met. Also it might be a performance issue if the table became very large and should be a
self-join.

READ ALSO
Combining results from two tables into JSON data

Combining results from two tables into JSON data

I have two tables, words and paragraphThe words table is as below:

29
How to query the unmodified timestamp inside a JSON object using MySQL?

How to query the unmodified timestamp inside a JSON object using MySQL?

I would like to query a JSON object containing a MySQL TIMESTAMP named 'time':

27
Multiple row INSERT from a single SELECT result

Multiple row INSERT from a single SELECT result

I am inserting multiple rows into a table, using the result from a subquery :

7
Equivalent Query from MySQL to PostgreSQL

Equivalent Query from MySQL to PostgreSQL

I'm switching from MySQL to PostgreSQL and trying to add a UNIQUE INDEX

16