Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Select all columns except one in MySQL?

SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), '<columns_to_omit>,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '<table>' AND TABLE_SCHEMA = '<database>'), ' FROM <table>');

PREPARE stmt1 FROM @sql;
EXECUTE stmt1;
Comment

PREVIOUS NEXT
Code Example
Sql :: oserror mysql_config not found virtualenv 
Sql :: sql update from another table join 
Sql :: concatenate text from multiple rows into a single text stringin SQL Server 
Sql :: android sqlite query con join 
Sql :: vs 2019 connect to local mysql database 
Sql :: datagrip go to line 
Sql :: maximum number of tables in mysql 
Sql :: inner join multiple conditions 
Sql :: mariadb datetime change to microseconds 
Sql :: sql bild in function 
Sql :: dbname+tablename 
Sql :: The fetch keyword oracle 
Sql :: How to Group by and concatenate arrays with all columns in PostgreSQL 
Sql :: create table in dbms cmds 
Sql :: codeigniter MySQL - Issue with SELECT & GROUP BY 
Sql :: sql count and addition by day 
Sql :: oracle parse string 
Sql :: mysql join 
Sql :: sql select merge multiple values 
Sql :: sql select statement 
Sql :: Adding a new table psql 
Sql :: IDE1006 (Naming rule violation) error problem 
Csharp :: how to lock and hide a cursor unity 
Csharp :: hello world in c# 
Csharp :: c# string equals ignore case 
Csharp :: get date of tomorrow c# 
Csharp :: c# remove last character from string 
Csharp :: string to int c# unity 
Csharp :: c# datetime dd/mm/yyy hh:mm:ss 
Csharp :: c# boilerplate 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =