Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Mysql-example SQL get Column Name

Related Tutorials


 
 

Share on Google+Share on Google+

SQL get Column Name

Advertisement
SQL get Column Name is used to return the Fieldnames of the table.

SQL get Column Name

     

SQL get Column Name is used to return the Fieldnames of the table.

Understand with Example

The Tutorial illustrate an example from 'SQL get Column Name'. To understand and elaborate example we create a table 'stu' with required fieldnames and datatypes respectively.

 

 

Create Table Stu:

Create Table Stu(Id int,Name Varchar(15));

Query:

The show columns is used to show fieldname and datatypes  from table 'Stu'.

SHOW COLUMNS FROM STU;

Result

+--------+-------------+------+-----+---------+-------+
| Field  | Type        | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| Id     | varchar(2)  | YES  |     |         |       |
| Name   | varchar(15) | YES  |     |         |       |
| Class  | varchar(10) | YES  |     |         |       |
| sub_id | varchar(2)  | YES  |     |         |       |
| marks  | varchar(3)  | YES  |     |         |       |
+--------+-------------+------+-----+---------+-------+
Advertisements

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: January 23, 2009

Related Tutorials

Discuss: SQL get Column Name   View All Comments

Post your Comment


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