xxxxxxxxxx
SELECT name FROM pragma_table_info('Uploads') ORDER BY cid;
xxxxxxxxxx
/* How to select the column names in SQL*/
SELECT Column_name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'your_table_name'
/* Just change the "your_table_name" ↑ to the name of your table */
xxxxxxxxxx
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'your_table_name';
xxxxxxxxxx
SELECT COLUMN_NAME AS 'ColumnName'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME LIKE '%assembly_armatureassy_tbl%'
and COLUMN_NAME LIKE '%supplied%'
xxxxxxxxxx
import sqlite3
# Connect to the database
connection = sqlite3.connect('your_database.db')
cursor = connection.cursor()
# Replace 'your_table' with the actual table name
table_name = 'your_table'
# Execute a query to retrieve the column names
cursor.execute(f"PRAGMA table_info({table_name})")
# Fetch all rows containing column information
columns = cursor.fetchall()
# Extract the column names (2nd item in each row)
column_names = [column[1] for column in columns]
# Print the column names
for column_name in column_names:
print(column_name)
# Close the database connection
connection.close()