dbTalk Databases Forums  

HELP !!! - Subselect problem

comp.databases.btrieve comp.databases.btrieve


Discuss HELP !!! - Subselect problem in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
hotzambo@cheapnet.it
 
Posts: n/a

Default HELP !!! - Subselect problem - 09-27-2007 , 03:08 AM






Hi, i try to run

Select F.Id,
(select Sum(RIWTE_FattRec.Prezzo * RIWTE_FattRec.Quantita)
FROM RIWTE_FattRec WHERE RIWTE_FattRec.IdFattura = F.Id ) as totale
from RIWTE_Fatture F


I receive this error
************************************************** **
ODBC Error: SQLSTATE = 37000, Native error code = 0
Syntax Error: Select F.Id,
(select<< ??? >> Sum(RIWTE_FattRec.Prezzo * RIWTE_FattRec.Quantita)
FROM RIWTE_FattRec WHERE RIWTE_FattRec.IdFattura = F.Id ) as totale
from RIWTE_Fatture F

Releases:
Pervasive Sql 8.50
Pervasive Control Center 8.50.189.000

Thanks to all.

Alessandro Zambonin


Reply With Quote
  #2  
Old   
ericpurdin@gamestop.com
 
Posts: n/a

Default Re: HELP !!! - Subselect problem - 10-01-2007 , 03:44 PM






Pervasive.SQL V8 does not support sub select statements.

After looking closer at your statement I don't think you need a sub
select to do this.

Try this instead:

Select F.Id, Sum(RIWTE_FattRec.Prezzo * RIWTE_FattRec.Quantita) as
totale
from RIWTE_Fatture F inner join RIWTE_FattRec on
RIWTE_FattRec.IdFattura = F.Id
group by F.Id

Hope this helps.

Eric Purdin


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.