we can create mysql query to select all fields, we can create mysql query to select necessary fields.
select * to select all fields
select fieldname to select specific fields, but is there any way to select all fields except 1 or 2
Thanks
Amit
Sudip Gautam :
This should help \n\nSET @query = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), '<OMITTED COLUMN>,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '<TABLE NAME>' ), ' FROM <TABLE NAME>');\n\nprepare statement from @query;\nexecute statement\n",
2015-04-17T06:45:10
Abhik Chakraborty :
In case of select specific fields you have no way but to select the specific columns as\n\nselect col1, col2, col3 ... from table_name \n\n\nLeave the columns which you do not want to select and add those you want to select.",
2015-04-17T06:26:45