SQL in firebird

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
suarahati
Posts: 6
Joined: Fri 26 May 2006 03:48
Contact:

SQL in firebird

Post by suarahati » Mon 05 Jun 2006 07:49

hi,

I'm really new in firebird.
its have different between mysql and firebird. Could you guide me where/what the sources if I want to refer the problem in sql statement in firebird.

thanks

suarahati
Posts: 6
Joined: Fri 26 May 2006 03:48
Contact:

Post by suarahati » Mon 05 Jun 2006 08:04

select SUM(MARKAH.GRED='''TH''') as TH,
SUM(MARKAH.GRED='''X''') as X,
SUM (MARKAH.GRED '''') as JUM from markah inner join
maklumat_pelajar on maklumat_pelajar.id_pelajar=markah.id_pelajar where markah.id_matapelajaran =1
and
maklumat_pelajar.id_kelas=1
and markah.id_peperiksaan=1

An error occur...Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, char 23.
=.

Could u please help me

suarahati
Posts: 6
Joined: Fri 26 May 2006 03:48
Contact:

Post by suarahati » Tue 06 Jun 2006 03:43

could anybody help me.?

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Tue 06 Jun 2006 08:19

InterBase or Firebird SQL doesn't support such constructions in SELECT clause, you should use join with SELECT COUNT (*) FROM ... WHERE ... or declare stored procedure that returns desired values.

Please note that we do not provide support for Firebird or InterBase database or other database servers (if you need information about them please contact their vendors), we support our products only. This forum is dedicated on IBDAC, so here you can post questions if you experience any problem with IBDAC.

Post Reply