Re: [sqlalchemy] MySQL's TRIM statement in sqlalchemy

2014-12-26 Thread Michael Bayer
Robert Buchholz wrote: > Hello, > > I am trying to write the following query in MySQL (in essence): > SELECT TRIM(TRAILING "-2" FROM c.slug) > FROM categories c; > > In reality, the column this is run on is an anonymous aliased table in a > JOIN expression*. Is it possible to generate the T

Re: [sqlalchemy] Finding the most recent raw (sqlalchemy core)

2014-12-26 Thread Michael Bayer
this is more of a SQL question. You’d want to query on max(timestamp) and group by name/value. assuming you haven’t worked with GROUP BY before, go through a tutorial like http://www.w3schools.com/sql/sql_groupby.asp and figure out exactly what plain SQL you want. Then bring that back here

[sqlalchemy] MySQL's TRIM statement in sqlalchemy

2014-12-26 Thread Robert Buchholz
Hello, I am trying to write the following query in MySQL (in essence): SELECT TRIM(TRAILING "-2" FROM c.slug) FROM categories c; In reality, the column this is run on is an anonymous aliased table in a JOIN expression*. Is it possible to generate the TRIM(TRAILING X FROM Y) with an SQLa funct