sql server ce query question
hi,
i have two tables
products that have the name and code and stock_products that have the
current stock
and i want in a single query see the especific value of the table stock_products
for example
from table one: code of product and from table two the stock of the
product
in secund table i have many records that belong for the same product
but i want only the last record
now the great question
how can i do that?
thanks a lot for your help :)
i using sql server ce
Re: sql server ce query question
I've never worked with CE so I don't know if this will work. If your Primary Key is of identity type then see if you can incorporate this in you statement.
Code:
SELECT *
FROM TABLE
WHERE ID = (SELECT MAX(ID) FROM TABLE)
Re: sql server ce query question