Which of the following mysql statements does it mean?

Source: Internet
Author: User
What does mysql statement mean? SELECTtid, MAX (a. ctime) ASa_time // What is the use of max? A. What does ctime mean? FROMtcASa // a indicates the table currently queried? LEFTJOINtutorASbONa. tid = B. mysql statement. who can help me see what it means?
SELECT tid, MAX (a. ctime) AS a_time // What is the use of max? A. What does ctime mean?
FROM tc AS a // a indicates the currently queried table?
Left join tutor AS B ON a. tid = B. id // B indicates the tc table? What does this sentence mean?
WHERE a. ctime> 1340590489
AND time <> 0
Group by tid
Order by a_time DESC
LIMIT 20

------ Solution --------------------
A indicates the tc table, B indicates the tutor table, and max indicates the maximum value in the ctime obtained from the tc table.
------ Solution --------------------
The entire statement is left join query.
FROM tc AS a // a indicates the currently queried table?
A is the alias of tc.
// What is the use of max? A. What does ctime mean?
Max is a mysql function.
A. ctime is the ctime field of a (tc table ).
Left join tutor AS B ON a. tid = B. id // B indicates the tc table? What does this sentence mean?
B is the alias of the tutor table. on is followed by the connection condition.

This is the foundation of mysql. I suggest you go to the manual.
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.