db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dieter Engelhardt" <Dieter.Engelha...@Iris-Solutions.de>
Subject AW: count(*) implementation
Date Fri, 26 Dec 2003 12:28:41 GMT
Hi Hassan,
here is a example how i solved it:

protected Object getTourCount() throws Exception
{
	List v = BasePeer.executeQuery("select count(*) as tourcnt from tb_tour");
	return v.get(0);
}

Cheers
Dieter

-----Ursprungliche Nachricht-----
Von: Hassan Abolhassani [mailto:Hassan.Abolhassani@razorfish.co.jp]
Gesendet: Freitag, 26. Dezember 2003 10:33
An: Apache Torque Users List
Betreff: count(*) implementation


Hi,

What is the best way to implement a query like following in Torque:

  select count(*) from table1, table2 
  where table1.id=table2.id and table2.field='something'

I want to have a function in peer class of table1 like:

  public static int getCount()

That returns the result of that count.

___

Razorfish Japan, Inc.

アボルハッサニ ハッサン   Hassan Abolhassani  [Technology network]
株式会社 レーザーフィッシュ・ジャパン
Hassan.Abolhassani@razorfish.co.jp
Tel:03-5436-9980 Fax:03-5436-9126


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message