Hi i need help on how to create a query so that the result will be like in my attach screenshot

Recommended Answers

All 3 Replies

You can use a JOIN to do this. You need to select the rows from each table, then describe how rows are related. Such a query will look something like this:

-- select rows
select Products.ProductID, Products.Description, Products.Value, StockOnHand.QtyInStock
-- from each joined table
from Products
join StockOnHand
-- describe how rows are related
on Products.ProductID = StockOnHand.ProductID
-- limit the results according to selection criteria
where Products.Value > 10.00
-- set order
order by StockOnHand.QtyInStock
-- set grouping
group by Products.Description

This is just an example to show you the syntax, have a try with your particular tables and columns and see what you can come up with. :)

it returns more than 4 rows in my query using left outer join

Can you post your query?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.