Let's take a look at an SQL statement!

Source: Internet
Author: User
Let's take a look at an SQL statement! This post was last edited by u010250831 at 00:40:02

SQL as php mysql

The following is an SQL statement for the zen cart open-source mall 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." pd
Where p. products_id = pd. products_id
And pd. aggregate age_id = '". (int) $ _ SESSION ['ages _ id']."'
And p. products_status = 1 ". $ display_limit;

In the preceding SQL statement, "p" and "pd" are aliases!
However, the [from ". TABLE_PRODUCTS." p, ". TABLE_PRODUCTS_DESCRIPTION." pd] clause does not use As when defining aliases. why? Is it an alias? Is there any other possible usage? Please kindly advise!


Reply to discussion (solution)

As can be left empty.

When running the SQL statement, directly output the SQL statement and put it in the editor for execution.

As writable or not

As depends on the situation, generally can not write,

However, some environment configurations require that the

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.