Home Mysql Mysql5 Identifiers Qualifiers

Related Tutorials


 
 

Share on Google+Share on Google+

Identifiers Qualifiers

Advertisement
This page discusses - Identifiers Qualifiers

Identifiers Qualifiers

     

In this section you will be read, MySQL allows names that have single identifier or multiple identifiers. The multiple part name of components can be separated by period ?.? Characters and initial parts of multiple-part name work as qualifiers that affect the context within which the final identifier is interpreted

You can refer to a column any of the following form in MySQL.  

  • col_name: The column col_name that is used from which table in statement have a column of that name.
  • tbl_name.col_name:- The column col_name from table tbl_name of the default database.
  • db_name.tbl_name.col_name:-The column col_name from table tbl_name of the database db_name.

If a multiple-part name of any component need the quoting then quote them individually rather than the name as a whole. For example, you have to write ?Emp-table?.?Emp-column? rather than ?Emp-table.Emp-column?. You should not specify tbl-name or db_name.tbl_name prefix to a column reference in a statement until the reference would be ambiguous. For example ? Table1 and Table2 both have column age and we retrieve the column age by a SELECT statement that used by both table. In this situation, column age is ambiguous because it is not unique and both tables used it in the statement. That?s why we have to qualify the column age with a table name as table1.age or table2.age for indicating which table you mean.

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Identifiers Qualifiers  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com