MySQL Forums
Forum List  »  Knowledge Base

Re: Urgent -Search column name by column number
Posted by: Paul Svirin
Date: October 06, 2009 04:36AM

Run this one (this is an example):

mysql> select column_name from INFORMATION_SCHEMA.columns WHERE table_schema='test' and table_name='tbl1' and ordinal_position=1;
+-------------+
| column_name |
+-------------+
| id |
+-------------+
1 row in set (0.01 sec)

Then read about dynamic SQL in MySQL at : http://rpbouman.blogspot.com/2005/11/mysql-5-prepared-statement-syntax-and.html

--------------
StarWind Software developer ( http://www.starwindsoftware.com )

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Urgent -Search column name by column number
2962
October 06, 2009 04:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.