MySQL connection query

Source: Internet
Author: User

The previous query is just a random look at the results, because found that the number of each query is very small, of course, it is now. But efficiency has always been the pursuit of the programmer, I will learn more about the gap.

The first is the multiple table union, a template category category, a Template table templates, a window table Shopwin, a Window type form table type

Now you want to query a window type of 1, that is, the type=1 template information in Shopwin. Template information in the Templates table, each of these is a template information. Constraints in the Shopwin table, the Shopwin table stores the corresponding relationship between the template and type. Each one is a type and a template counterpart.

In this way, I need to connect category,template,shopwin three tables to query the information for all the templates contained in the Window Type 1 window.

1 Select template information (t.category to replace C.name) 2  from Shopwin s,template t,category c 3 where s.type=14 and s.template=t.id5   and t.category=c.id

MySQL connection query

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.