4
有誰知道我可以做計數如果SQL鍊金術一樣SQLAlchemy的COUNT和IF
COUN(IF(table_row = 1 AND table_row2 =2),1,0)
我做這樣的事情,
func.COUNT(func.IF((TransactionMessage.tm_read==0 and TransactionMessage.tm_type==1),1,0)).label('t_message_count'),
但是,如果與TransactionMesssage.tm_read的SQLAlchemy讓2個獨立的, 和TransactinMessage.tm_type
可以somone幫我解決問題嗎?
感謝對幫助,它的工作! – gummmibear 2010-10-20 20:40:10
感謝您的支持。它在SQLAlchemy站點中沒有記錄。 – fccoelho 2011-03-11 17:51:43