MySQL Forums
Forum List  »  Stored Procedures

Re: dangers of query by ordinal value
Posted by: Devart Team
Date: February 10, 2012 01:13AM

I just will simplify your solution. This query will get the list of two fields:

SELECT GROUP_CONCAT(COLUMN_NAME) INTO @fields FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = 'db_nme' AND TABLE_NAME = 'table_name' AND ORDINAL_POSITION < 3;

SELECT @fields;

...note, that you should pass schema name too.

Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/

Options: ReplyQuote


Subject
Views
Written By
Posted
1794
February 06, 2012 07:46PM
Re: dangers of query by ordinal value
839
February 10, 2012 01:13AM


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.