select cu.column_name from information_schema.table_constraints t left join information_schema.constraint_column_usage cu on t.constraint_name = cu.constraint_name and cu.table_name = t.table_name left join information_schema.columns c on c.column_name = cu.column_name and c.table_name = cu.table_name where constraint_type = 'primary key ' and cu.table_name = '' order by c.ordinal_position
- 0
- 0
- 0
- 0