guvna Posted November 21, 2017 Share Posted November 21, 2017 Up to this point in the book all references to tables and fieldnames have been spelt out in full. In this chapter the examples introduce a new format for the syntax: SELECT m.message_id, m.subject, f.name etc Whilst the code works as described I cannot find any description for the preceding character and period syntax or choice of character. An explanation would be very useful for me to better understand this process if anyone could provide it please. Link to comment Share on other sites More sharing options...
Larry Posted November 22, 2017 Share Posted November 22, 2017 Sorry about the confusion! Earlier in the book or chapter you'll find a reference to AS, which creates an alias. So just after the bit you posted there will be something like `FROM messages AS m` which simply says "for the sake of simplicity, let's call this table 'm' in most of this query". Just can also create aliases for column names and the results of function calls. Hope that helps! Link to comment Share on other sites More sharing options...
guvna Posted November 22, 2017 Author Share Posted November 22, 2017 OK so the alias AS I get. The m.messages relates to the table for the 'AS m' part. The fact that you use m for messages table, f for forum table could just as easily be x and y? Link to comment Share on other sites More sharing options...
Larry Posted December 1, 2017 Share Posted December 1, 2017 Yes, that's exactly correct! Link to comment Share on other sites More sharing options...
Recommended Posts