Code Monkey home page Code Monkey logo

Comments (3)

mceachen avatar mceachen commented on June 10, 2024

Please try to simplify your example as much as possible, and in a reproducible code snippet (we're all volunteers here!)

from better-sqlite3.

neoxpert avatar neoxpert commented on June 10, 2024

When this column would start with a number it results in a SqliteError: unrecognized token error.

Did you try to just quote your identifiers? Just to make you statement more expressive. If the column starts with number, is it guaranteed to not just consist of digits but also has some other characters in its name?

SELECT 
    COUNT(*) AS "count"
FROM 
    "JOB"
WHERE 
    ('61' IN (
        WITH "split"("option", "csv") AS (
            SELECT 
                '', 
                "<whatever column name>" ||',' 
            FROM 
                "JOB" j2 
            WHERE 
               j2."id" = "JOB".id 
            UNION ALL 
            SELECT 
                substr("csv", 0, instr("csv", ',')), 
                substr("csv", instr("csv", ',') + 1) 
            FROM 
                "split" 
            WHERE 
                "csv" != '' 
        ) 
        SELECT "option" FROM "split" WHERE "option" != ''
    )
) 

from better-sqlite3.

LaurentDhont avatar LaurentDhont commented on June 10, 2024

I am terribly sorry for wasting your time. There where 2 places in my code and I only changed one to include the column name in brackets. It was one of those days...

Very sorry and thanks a lot.

from better-sqlite3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.