A
A
Akakiy18802020-11-10 16:43:56
Python
Akakiy1880, 2020-11-10 16:43:56

How to get single cell value from postgre sql table using python?

when querying 'SELECT access FROM table WHERE id = 12345;' to the database through python and calling the fetchone() function, 2 values ​​are returned: field values ​​and an empty value. How to make it so that only the value of the cell is returned when querying without using such a fetchone () [0] construct

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-10
@bacon

There is no second empty field there, read what fetchone returns, then to the basics of python and how to work with tuples.
PS for fetchone () [0] to kick until enlightenment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question