Query-problem in MySQL

Query-problem in MySQL

Postby Marc Vanzegbroeck » Thu Aug 09, 2012 7:51 am

Hi,

I have a problem in a Query syntax while converting my program from SQLite to MySQL.
In the table 'factui' there is a numeric field 'factuurnr'

In SQLite the command
oQry=oSQL:Query( 'SELECT SUBSTR(factuurnr,1,4) FROM factui DESC GROUP BY SUBSTR(factuurnr,1,4)' )


is working fine, but in MySQL I get a syntax error.
Does anyone know how to make this query in MySQL?

Thanks,
Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Query-problem in MySQL

Postby Marc Vanzegbroeck » Thu Aug 09, 2012 8:37 am

Problem solved,

It sould be
oQry=oSQL:Query( 'SELECT SUBSTR(factuurnr,1,4) FROM factui GROUP BY SUBSTR(factuurnr,1,4) DESC' )


The HeidiSQL program that comes with MarioDB is a very nice program vor cheching the database and query...

Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 108 guests