An SQL query gives me a list of tuples, like this:
[(elt1, elt2), (elt1, elt2), (elt1, elt2), (elt1, elt2), (elt1, elt2), ...]
I'd like to have all the first elements of each tuple. Right now I use this:
rows = cur.fetchall()
res_list = []
for row in rows:
res_list += [row[0]]
But I think there might be a better syntax to do it. Do you know a better way?