SQL implementation calls the latest Five list thumbnails.
Source: Internet
Author: User
SQL calls the latest Five list thumbnails for help .. {Dede: sqlsql = & quot; SELECTtypename, typedir, typeimgFROMdede_arctypewhereid & gt; 7 & quot;} & lt; li & gt; & lt; SQL calls the latest Five list thumbnails for help ..
{Dede: SQL = "SELECT typename, typedir, typeimg FROM dede_arctype where id> 7 "}
[Field: typename/]
{/Dede: SQL}
I used this statement to call up all list thumbnails, but in this case, all thumbnails are called .... But now I want to add a function so that he can only call the latest five messages.
I checked some information and I think many people added the limit statement to the end .. But I really don't understand this. please help me write a code.
------ Solution --------------------
SELECT typename, typedir, typeimg FROM dede_arctype where id> 7 order by time desc limit 5
------ Solution --------------------
How is the latest field represented? for the order by field desc limit 5
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service