- Where Developers Learn, Share, & Build Careers


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

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -