What does the decimal point in a MySQL query mean,

Source: Internet
Author: User
Tags mysql query
I see that there is a select G.name SUM (og.names_number) as Names_number; this g. What do you mean, why there is a decimal point ah, there is no g in the table


Reply to discussion (solution)

. The previous q indicates the table name or the workspace (alias), and you've pasted the instructions.

Select G.id,g.name from table as G

G represents the alias of the table, if the table name is long can be replaced by an alias,

Library name. Table name. Field Name
That's the whole story.

Look for the whole sentence there is no as g, if there is, G is the alias. G.name is the Name field in the data for this alias.
For example
Select G.name,c.name from table1 as G, table2 as C

If not, then G could be a database name
Select G.name from table

Oh it's an alias, so what's the definition of this alias, as G?

As can default

Select g.* from Tbl_name as G
Select g.* from Tbl_name g

It's all possible.

Okay, thank you, it's a knot.

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