sqlitebrowser / sqlitebrowser

Official home of the DB Browser for SQLite (DB4S) project. Previously known as "SQLite Database Browser" and "Database Browser for SQLite". Website at:
https://sqlitebrowser.org
Other
21.19k stars 2.14k forks source link

Execution finished with errors. Result: near "(": syntax error At line 1: #3586

Open geofsharp opened 7 months ago

geofsharp commented 7 months ago

DB Browser for SQLite 3.12.2 Linux AppImage

Execution finished with errors. Result: near "(": syntax error At line 1:

DB Browser for SQLite Version 3.12.1

Execution finished without errors. Result: 2 rows returned in 11ms At line 1:

with seqta_sub as (
    select distinct
    House,
    StudentCode as 'Student ID',
    Surname || ', ' || preferred as 'Student',
    YearLevel as 'Year_Level',
    substr(Roll,14,2) as 'Roll Group',
    SubjectCode as 'Class Code',
    Subject,
    Teacher,
    Affective1 as 'Progress Grade',
    '' as 'Att Rate Ave'
from tbl_seqta
    where StudentCode like '106253435A' and (CalcGrade like 'D%' or CalcGrade like 'E%' or CalcGrade like 'N%' or CalcGrade like 'X')
    order by House, Roll, YearLevel, StudentCode, Surname, Preferred    
),
level_sub as (
    select
        *,
        count(*) over (partition by 'Student ID') as den_count
    from
        seqta_sub
)
select 
    *,
    case
        when den_count >= 1 and Year_Level = '12' then 'level 3'
        when den_count >= 1 and den_count <= 2 then 'level 1'
        when den_count >= 3 and den_count <= 4 then 'level 2'
        when den_count >= 5 then 'level 3'
    end as level
from level_sub
justinclift commented 7 months ago

@geofsharp I've just transferred this issue to the "sqlitebrowser" repository, which I think is the correct one. Also added some formatting to the SQL text, so it's easier to read.

That being said, you should probably try the .AppImage for our latest development build:

https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/continuous

That's had a lot of work since our 3.12.2 release, and it's pretty solid. (We're near to a next release too). :smile: