For loop through specific columns of table and pass to relational SQL statement

  Kiến thức lập trình

I want to loop through columns [‘A’, ‘B’, ‘C’] and pass the column names to a select statement in SQL, such as

SELECT * FROM table_name
WHERE table_name.`A` IS NULL

Thus each select statement would yield a result set based on the column name. This would be contained in a sql script. I would then read each result through a python DB connection, such as mysql-connector. How would I go about doing this? Thank you!

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT