SQL ON
Posted on: January 23, 2009 at 12:00 AM
The ON clause is used to specify name of the fieldname on which index is created.

SQL ON

     

The ON clause  is used to specify  name of the fieldname on which index is created.

Understand with Example

The Tutorial illustrate an example from table 'SQL ON'. To understand and grasp the example we create a table 'Stu' that has the required fieldnames and datatypes respectively.

 

 

 

 

Create Table Stu:

Create table stu(id int, name varchar(10));

Create Index:

The Create Index keyword creates a index 'index_on_id' on table 'stu' field 'id'.

mysql> CREATE INDEX index_on_id ON stu (id);
Query OK, 3 rows affected (0.06 sec)
Records: 3  Duplicates: 0  Warnings: 0

Insert values into stu:

The insert into is used to add the records or rows to the table 'stu'.

insert into stu values (1,'komal');
insert into stu values (2,'ajay');
insert into stu values (3,'santosh');

Stu Table:

The select keyword return the results of record details from table 'stu'.

mysql> select * from stu;
+------+---------+
| id   | name    |
+------+---------+
| 1    | komal   |
| 2    | ajay    |
| 3    | santosh |
+------+---------+
3 rows in set (0.00 sec)

Related Tags for SQL ON:
csedfieldnamecreateifindexietoldcieusepeinmclauseclspecmewhichsspcreatedatisdneassthdnandono


More Tutorials from this section

Ask Questions?    Discuss: SQL ON  

Post your Comment


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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.