If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysterious letter?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-07, 12:37
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
mysterious letter?

Hi to all,

Has anyone noticed that when you used the MySQL Query Browser and then try to click any of the existing schemas in you database, and then double click a certain table in that chosen schem. what happens is that you are issuing a select query of all the data in that particular table right?

Ex: I double clicked my users table, then a certain text appears at the Resultset Tab:

SELECT * FROM tblusers t;

Notice the letter 't' in there? I have been wondering what is the purpose or significance of that letter, every time you double click a table and when that select query text appears, a letter (any letter) appends to the select query text?

Any ideas on what is that?
I noticed that the appended letter is the first letter of the table that I have double clicked.

thanks and god bless!
Reply With Quote
  #2 (permalink)  
Old 06-13-07, 12:45
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by Panoy
I noticed that the appended letter is the first letter of the table that I have double clicked.
it is? that's cute

what you're seeing there is called a table alias

you are not required to use one, except if you're referencing the same table more than once in a query
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-13-07, 12:53
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
is that all? hey thanks
Reply With Quote
  #4 (permalink)  
Old 06-14-07, 03:46
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
Yes that is all, however, tell me which is easier to write?

Code:
SELECT t1.column1
        , t2.column2
        , t1.column3
FROM table1 t1
JOIN table2 t2 ON t2.id = t1.id
WHERE t1.id IN (
  SELECT t3.id 
  FROM table3 t3
)
OR

Code:
SELECT table1.column1
        , table2.column2
        , table1.column3
FROM table1
JOIN table2 ON table2.id = table1.id
WHERE table1.id IN (
  SELECT table3.id 
  FROM table3
)
I know which I prefer. Now just imagine if you table name is "myReallyLongTableName". How do you fancy writing that out several times (and possibly getting a spelling mistake).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On