Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

SQL get Column Name

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

Ads

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

Share on Google+Share on Google+

SQL get Column Name

Posted on: January 23, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: SQL get Column Name   View All Comments

Post your Comment


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

Ads

 

Ads