13

I'm new to MySQL. Can anyone describe lines below which I get theme from the demo of the jqgrid, what is the meaning of a.id? What is the meaning of these dots?

$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";

You can find the example here: http://trirand.com/blog/jqgrid/jqgrid.html in the advanced>Multi select

3 Answers 3

14

You've asked several questions here. To address the dots:

In the FROM clause, a is used as an alias for the invheader table. This means you can reference that table by the short alias a instead of the full table name.

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

It is generally considered bad practice to simply give your tables the aliases a, b, c, etc. and I would recommend you use something more useful.

I suggest you read some basic MySQL tutorials as this is a fundamental principal.

0
5

The dot(.) is used to separate the board scope.So Songs.songId mean that first find the table named Songs and then in the Songs table find the field named songId.

2

In my opinion, that DOT NOTATION is used for fetching information from right side of the syntax. That means, a.id which means you fetch the data from "a table". In this case, you use the aliases name, then it runs '.id'which means it fetches data 'ID'from a table.If it is wrong, please comment that wrong statement. thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.