mysql:show all value of three fields
i have a q开发者_JS百科uestion... i have a DB..i'm just want to show all value of 3 fields from DB,they are Line,Model,and NIK... i want it order by insp_datetime field...and descending..limit 0,30..
i've been try like this:
SELECT * FROM Inspection_report
WHERE NIK='".$NIK."' AND Line='".$Line."' AND Model='".$Model."'
ORDER BY Insp_datetime DESC
LIMIT 0,30;
But i think it's wrong..can you give me the correct code?
Your question isn't entirely clear, but I think what you want is:
SELECT NIK, Line, Model FROM Inspection_report
ORDER BY Insp_datetime DESC LIMIT 0,30;
which will give you the NIK, Line, and Model of the most recent 30 inspections.
精彩评论