Share via

SQL query dot operator with field name

Anonymous
2014-02-13T14:14:46+00:00

I have found a solution to a problem I am working on but need some help understanding the SQL statement. A sampling of the tables:

LGLINE (table)

   inv_num

   line_num

   prod_SKU

   line_Qty

   line_Price

LGPRODUCT (table)

   prod_SKU

   prod_Desc

   ....

The working query starts with the following:

SELECT l.inv_num, l.line_num, p.prod_sku,

p.prod_descript, l2.line_num, p2.prod_sku,

p2.prod_descript, p.brand_id

FROM (lgline AS l INNER JOIN lgproduct AS p

ON l.prod_sku = p.prod_sku)

INNER JOIN

(lgline AS l2 INNER JOIN lgproduct AS p2

In my study to this point, I have not seen how the l.inv_num, l.line_num, p.prod_sku syntax works.

The inv_num in the first line of the query is the name of the field but what does the l. (ldot)  and p. (pdot) do and how does it work.

Thank you for your help.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-02-13T14:33:29+00:00

Hi,

in your query you use

FROM (lgline AS l

that is: refer with the Alias I the table lgline.

Then to refer fields of lgline table you use I.FieldName instead of lgline.FieldName

Mimmo

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful