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