What do the dots in this SQL query mean?

I am new to MySQL. Can someone describe the lines below which I get the topic from a jqgrid demo, what is the meaning of a.id? What is the meaning of these points?

$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit"; 

Here you can find an example: http://trirand.com/blog/jqgrid/jqgrid.html in advanced> Multi select

+6
source share
2 answers

Here you have asked some questions. To address points:

In the FROM a used as an alias for the invheader table. This means that you can refer to this table with a short alias a instead of the full name of the table.

Therefore, a.id refers to the id column of the invheader table.

It is generally believed that bad practice simply gives your tables aliases a , b , c , etc., and I would recommend that you use something more useful.

I suggest you familiarize yourself with some of the basic MySQL tutorials, as this is a fundamental principle.

+5
source

Point ( . ) Is used to separate the board's field of view. So Songs.songId means that first find the table named Songs, and then in the Songs table find the field named songId.

+1
source

Source: https://habr.com/ru/post/920484/


All Articles