Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のテーブルがある場合:
ID Name Price RRP 1 Shirt 10.00 20.00 2 Jeans 15.00 30.00
最大の節約 (ID 2) を持つ行を取得するにはどうすればよいですか?
Select Id,Name,Price,RRP FROM TableName Order By (RRP-Price) Desc Limit 1
SELECT ID, Name, Price, RRP, RRP-Price AS saving FROM Table ORDER BY saving DESC