How to retrieve python list of SQLAlchemy result set? -


I have the following questions to get a column of data:

  routes_query = Select ([Schema.stop_times.c.route_number], schema.stop_times.c.stop_id == stop_id) .distinct (schema.stop_times.c.route_number) results = conn.execute (routes_query) returns [r ['route_number' ] Results in R]]   

I'm thinking that data is a cleaner way to bring back the original list of rows.

1-element is the shortest way to draw the list of tuples in the list: < Pre> result = [r [0] for result in R]

or:

  result = [r for r, result In]    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -