need help qith temporary table
Posted in 2000
Topics: SQL Development & Query Writing, Connectivity: ODBC / JDBC / .NET
Hey, I just created two temporary tables "q1" and "q2" for the user "straco" with a "SELECT .. INTO TEMP" (Thanks for help doing so). Now I am trying to send the following statement through JDBC but I always receive syntax error messages: "SELECT ( straco.q1.preis - straco.q2.preis ) / 100 AS Diff ,"+ "Sum ( straco.q1.Sales ) AS Sales1 , "+ "Sum ( straco.q2.Sales ) AS Sales2 , "+ "Count ( straco.q1.preis -straco.q2.preis ) AS Observations , "+ "Sales1 + Sales2 AS TotalSales , "+ "Sales1 / TotalSales AS Share1 , "+ "Sales2 / TotalSales AS Share2 "+ "FROM straco.q1 INNER JOIN straco.q2 ON ( straco.q1.vksnr_nr = straco.q2.vksnr_nr ) AND "+ "( straco.q1.woche_nr = straco.q2.woche_nr ) " + "GROUP BY ( straco.q1.preis -straco.q2.preis ) / 100"+ "ORDER BY Diff DESC" Can anybody help??? Oliver Sent via Deja.com http://www.deja.com/ Before you buy.
"Oliver Kühn" wrote: > I just created two temporary tables "q1" and "q2" for the user "straco" > with a "SELECT .. INTO TEMP" (Thanks for help doing so). Now I am > trying to send the following statement through JDBC but I always > receive syntax error messages: > > "SELECT ( straco.q1.preis - straco.q2.preis ) / 100 AS Diff ,"+ > "Sum ( straco.q1.Sales ) AS Sales1 , "+ > "Sum ( straco.q2.Sales ) AS Sales2 , "+ > "Count ( straco.q1.preis -straco.q2.preis ) AS Observations , "+ > "Sales1 + Sales2 AS TotalSales , "+ > "Sales1 / TotalSales AS Share1 , "+ > "Sales2 / TotalSales AS Share2 "+ > "FROM straco.q1 INNER JOIN straco.q2 ON ( straco.q1.vksnr_nr = > straco.q2.vksnr_nr ) AND "+ > "( straco.q1.woche_nr = straco.q2.woche_nr ) " + > "GROUP BY ( straco.q1.preis -straco.q2.preis ) / 100"+ > "ORDER BY Diff DESC" > > Can anybody help??? Does the version of the DBMS you are using recognize INNER JOIN as a syntax? Probably not; I'm not even sure whether any Informix DBMS recognizes it, but the 7.3x and 9.2x releases might do so. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"