mycursor = myconnect.cursor(buffered=False) mycursor.execute('SELECT name FROM name_table') myresult = mycursor.fetchall() for row in myresult: #print(row)
mycursor = myconnect.cursor(buffered=False) mycursor.execute('SELECT name FROM name_table') myresult = mycursor.fetchall() for row in myresult: #print(row)
[code python]
тут пиши код
[/code]
from_db = [] mycursor = myconnect.cursor(buffered=False) mycursor.execute('SELECT name FROM name_table) myresult = mycursor.fetchall() for row in myresult: myresult = list(myresult) from_db.append(row[0]) uniqueNames=set(from_db) print(uniqueNames)
mycursor = myconnect.cursor(buffered=False) mycursor.execute('SELECT name FROM name_table') myresult = mycursor.fetchall() from_db = [] for row in myresult: name = row[0] from_db.append(name) uniq_names = list(set(from_db)) print(from_db) print(uniq_names)