I am a beginner in python.
I have several tables (table1 , table2 , table3 ,...) in my database that they have same column TotalPrice
.
I want to store TotalPrice
of all the tables in one list
TotalPrice
is extracted by this code:
for j, v in enumerate(busList):
mc.execute('SELECT TotalPrice FROM bus'+v+' WHERE Date BETWEEN '+StartDate+' AND '+EndDate+'')
p = mc.fetchall()
price = [i[0] for i in p]
but i don't know how to store them just in ONE list!!!!!