Created
December 19, 2014 15:22
-
-
Save Marian0/dac25364716861ac0b5e to your computer and use it in GitHub Desktop.
Consulta para obtener productos con precio menor al de compra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from | |
product P, | |
(SELECT idProduct as prodStock, max(unitPrice) as maxPrice from buy B where stockAvailable>0 GROUP BY idProduct) L | |
WHERE | |
P.idProduct=prodStock | |
AND | |
P.unitSellingPrice<=maxPrice | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment