I'm trying to express the following SQL:
SELECT * FROM attendances a WHERE grade = (SELECT MAX(grade) FROM
attendances WHERE student_id=a.student_id) and school_id=112;
A2 = aliased(A) # A is Attendance class
q2 = s.query(max_grade).filter(A.student_id==A2.student_id).subquery()
print q2 #
try label the column in q2, say q2.maxgrade, then use that as
print s.query(A).filter( A.grade==q2.maxgrade)...
On Tuesday 12 May 2009 10:17:11 Max Ischenko wrote:
I'm trying to express the following SQL:
SELECT * FROM attendances a WHERE grade = (SELECT MAX(grade) FROM
attendances WHERE
On 12 май, 10:17, Max Ischenko ische...@gmail.com wrote:
I'm trying to express the following SQL:
SELECT * FROM attendances a WHERE grade = (SELECT MAX(grade) FROM
attendances WHERE student_id=a.student_id) and school_id=112;
I've got it working using literal SQL but there must be a
On Tue, May 12, 2009 at 4:54 AM, James rent.lupin.r...@gmail.com wrote:
So:
- what is the recommended database initialisation / cleanup strategy
for unit tests involving SA?
- can anyone suggest how ORM state could be hanging around between
unit tests (I'm using an in-memory DB)?
- is there
On Tue, May 12, 2009 at 11:43, a...@svilendobrev.com wrote:
try label the column in q2, say q2.maxgrade, then use that as
print s.query(A).filter( A.grade==q2.maxgrade)...
Doesn't work:
q2 =
s.query(max_grade.label('maxgrade')).filter(A.student_id==A2.student_id).subquery()
print
Hi,
in a sessionExtension.after_flush hook I create objects (namely todo
actions depending on what people have inserted/updated).
At present I create these objects in the current session, but I do
understand is not clean as the flush has already occurred. It almost
works, objects are
I correct myself
On 12 Mag, 11:05, Alessandro Dentella san...@e-den.it wrote:
Hi,
in a sessionExtension.after_flush hook I create objects (namely todo
actions depending on what people have inserted/updated).
At present I create these objects in the current session, but I do
mycode like:
department_table=Table('department',medadata,
Column('id',Integer,primary_key=True),
Column('name',String
(64),nullable=False,unique=True),
)
class Department(object):pass
doctor_table=Table('doctor',medadata,
you'd need to map Doctor also. at that point, creating a new Doctor
for the first time will compile all the mappers assembled and
Doctor will get a department descriptor.
On May 12, 2009, at 2:36 AM, manman wrote:
mycode like:
department_table=Table('department',medadata,
Hi, I also reported this problem on the pyodbc mailing list but maybe
one of you know a workaround.
I'm trying to use pyodbc on RHEL 5.3 64 bit but all my strings are
filled with garbage after position 1024. Here is an example:
import pyodbc
conn = pyodbc.connect('DRIVER={SQL
AFAIK, there's nothing in SQLA that will address this -- the issue sounds
new to me, and it seems to me that it's pretty clearly some kind of
pyodbc/FreeTDS issue. Check your character encoding settings, there's quite
a few reported issues with MSSQL + pyodbc + unicode statements. You may want
to
11 matches
Mail list logo