Help look at a SQL statement statement!

Source: Internet
Author: User
This post was last edited by u010250831 on 2013-09-20 00:40:02

SQL as PHP MySQL

The following is an SQL statement from the Zen Cart Open source Marketplace system!
Select distinct p.products_id, P.products_image, p.products_tax_class_id, Pd.products_name,
p.products_date_added, P.products_price, P.products_type, p.master_categories_id
From ". Table_products. "P,". Table_products_description. The PD
where p.products_id = pd.products_id
and pd.language_id = ' ". (int) $_session[' languages_id '. "'
and p.products_status = 1 ". $display _limit;

Both "P" and "PD" in the above SQL statements should be aliases!
But "from". Table_products. "P,". Table_products_description. The word "PD" is not used when defining an alias. Is it not an alias? Is there any other possible usage? Ask the great God for guidance!


Reply to discussion (solution)

As can not be written.

When running SQL, directly output SQL, put in the editor to do a look at the know.

As can write not write

As to see the situation, generally can not write,

However, some environment configurations will require MySQL multi-table federated nested queries to be added as

  • 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.