MySQL multi-table query is an error-solving method

Source: Internet
Author: User
MySQL multi-table query is an error
You are good, I do the forum in which there are three of the table, that is, in the reply page display, just like this page, but the right reply to the content can be queried from the data table, but the left of the reply to the basic information, can only query out one, that is, all the reply to the user's basic information is the same:
My table structure is like this, the main table, the reply table, the main fields in the user table
Main sticker topic: (Tid,topic,tcontent,tuname,ttime);
Reply Table reply: (rid,rtopic,rcontent,runame,rtime);
User table UESR: (Uid,uname,usex,ubirthday, etc.);

, where the main list contains the name of the subject (topic), the Reply table contains the subject Name field (Rtopic), and topic is the same as rtopic, and now I want to query the corresponding reply user (Rtopic) based on the name (rname) field of the reply topic. And then according to investigate the user name (Rname), from the user table (users) to investigate the corresponding (Rname) detailed information, please help solve the expert, thank you! It is best to give the SQL statement.


------Solution--------------------
SQL Code
  • 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.