This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Solved Retrieve data from sql


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 05-04-2024 , 11:07   Re: Retrieve data from sql
Reply With Quote #1

I just tested this with a local SQLite database, and it seems that AMXX has such an old version of SQLite that it doesn't support CTE's (common table expressions), or window functions like RANK(). I did some research and these features were introduced in SQLite after 2013, so that's probably why you're seeing the syntax error.

I checked the SQLite version of AMXX 1.9.0:

Code:
format( sQuery, charsmax(sQuery), "SELECT sqlite_version();");
-> 
L 05/04/2024 - 17:59:07: [zm_rank.amxx] Current version of SQLite: 3.24.0
CTEs were indroduced from version 3.8.3, and window functions were introduced in 3.25.0.


I've simplified the query, I replaced all the newer functions with subqueries that should be compatible with almost any version of SQLite, so try this:

Spoiler
__________________
Rohanlogs is offline
Old 05-14-2024, 19:50
N3v3rM1nd
This message has been deleted by N3v3rM1nd.
N3v3rM1nd
Member
Join Date: Apr 2021
Old 05-04-2024 , 19:13   Re: Retrieve data from sql
Reply With Quote #3

Working like a charm, thanks man
I will come back with a reply if I encounter problems in the future
N3v3rM1nd is offline
Reply



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

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

Forum Jump


All times are GMT -4. The time now is 02:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode