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:[EMAIL PROTECTED]
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]
株式会社 レーザーフィッシュ・ジャパン
[EMAIL PROTECTED]
Tel:03-5436-9980 Fax:03-5436-9126


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to