I have a database with the following format.
(1, 'Kristen', 'Klein', '2002-11-03', 'North Cynthiafurt', 'AZ', '50788')
I am trying to strip away the first and last name values and pass them to a function to concatenate them as strings. "Kristen Klein" in this case.
I use a query such as:
query_first = db.select([customer.columns.first_name])
proxy_first = connection.execute(query_first)
result_first = proxy_first.fetchall()
print(result_first)
to extract all the first name values and they come out like this: [('Kristen',), ('April',), ('Justin',)]
I use an identical one for the last names and get an identical output.
This syntax is confusing to me as it appears to be a dictionary (?). How do I convert these to strings so that I may concatenate them into a cohesive name?
[('Kristen',), ('April',), ('Justin',)]- is a list of tuples.SELECT firstname,lastname FROM tablename;and you will have a output like this[('firstname', 'lastname'), ('Kristen', 'Klein'), ... ]sqlalchemyplease