I would like something to run on the Query class. It looks like you used to be able to run select on this class, but the function is deprecated. If I cannot, I will just use the execute function and run plain SQL.
On Nov 7, 6:39 am, Barry Hart <[EMAIL PROTECTED]> wrote: > Is this what you want? > > select([my_table.c.my_column], distinct=True) > > Barry > > ----- Original Message ---- > From: JamesT <[EMAIL PROTECTED]> > To: sqlalchemy <[email protected]> > Sent: Wednesday, November 7, 2007 2:05:13 AM > Subject: [sqlalchemy] Select entire column > > I am looking to filter specific columns in a table, but I cannot find > how to do this. I can filter by setting these columns to a value, but > not just grabbing the entire column. In SQL, I want to do this: > "SELECT artist FROM artist_table", where the only column kept is > artist. The reason I want to do this is so that I can run a distinct() > on the Query object returned to get the distinct artists and also > distinct genres. Here is a sample of what I am doing now without > filtering to get the data I need: > > tuples = Session.query(Albums).add_entity(Songs).join('songs').all() > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > aroundhttp://mail.yahoo.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
