Jump to content
Larry Ullman's Book Forums
guvna

Chapter 7: Performing Joins Syntax 'character Period' Preceding Fieldname

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...