I am using the following SQL command to get all column names from my table in MySQL:
SELECT column_name FROM information_schema.columns where table_name = 'сведения о фильме' and table_schema = 'videokassety2';
It give me all column names in the table 'сведения о фильме', however it sorts the results and gives me the following:
ID Компании
Год выпуска
Название фильма
Номер фильма
Основные исполнители
Характер фильма
However, I do not need sorting, I need the order in which they appear in the table itself, like the following:
enter image description here
How can I get a list of column_nmaes without any sorting?
Thank you
The column ordinal_position has the original column ordering information:
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'сведения о фильме' AND table_schema = 'videokassety2'
ORDER BY ordinal_position;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With