Skip to content

Instantly share code, notes, and snippets.

@Lkledu
Last active July 30, 2019 12:24
Show Gist options
  • Save Lkledu/8912ffa00d3c75a934e9e1887d167f65 to your computer and use it in GitHub Desktop.
Save Lkledu/8912ffa00d3c75a934e9e1887d167f65 to your computer and use it in GitHub Desktop.
select all columns minus one <POSTGRESQL>
//select all columns from table minus one column;
//work like describe
//use this to create function to select all columns with values from table, minus one column
//like this: (select *-'column_name' from table_name)
select TABLE_NAME, COLUMN_NAME from information_schema.columns where TABLE_NAME = 'table_name' AND COLUMN_NAME != 'column_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment