About 5,830,000 results
Open links in new tab
  1. SQLite table constraint - unique on multiple columns

    I can find syntax "charts" on this on the SQLite website, but no examples and my code is crashing. I have other tables with unique constraints on a single column, but I want to add a …

  2. How to add unique constraint to existing table in Sqlite?

    Mar 19, 2013 · You can't add a constraint to an existing table in SQLite. (In SQL there is an option to do that). You need to re-create the table with necessary contraints. There is only a few …

  3. What happens if you declare an SQLite column PRIMARY KEY

    SQLite's documentation says: A UNIQUE constraint is similar to a PRIMARY KEY constraint, except that a single table may have any number of UNIQUE constraints. What I'm wondering …

  4. Efficient way to ensure unique rows in SQLite3 - Stack Overflow

    I am using SQLite3 in one of my projects and I need to ensure that the rows that are inserted into a table are unique with regard to a combination of some of their columns. In most cases the rows

  5. sql - SUM unique GROUP BY values in sqlite and count groups of ...

    Apr 9, 2025 · I'm quite a novice sql user and I'm struggling with a sqlite query over a GROUP BY. Here's a simplified example of my problem using this table data: id, pid, tid, duration 1, 1, 12, …

  6. sqlite - How to SELECT DISTINCT of one column and get the …

    And I want to get the same result as with SELECT DISTINCT Code FROM table (00001,00002,00003) but with all of the other table columns. If I perform SELECT DISTINCT …

  7. SQLITE_CONSTRAINT_PRIMARYKEY: sqlite3 result code 1555: …

    SQLITE_CONSTRAINT_PRIMARYKEY: sqlite3 result code 1555: UNIQUE constraint failed: Persons.id Asked 9 years, 10 months ago Modified 1 year, 7 months ago Viewed 227k times

  8. SQLITE select unique rows - Stack Overflow

    Nov 11, 2019 · SQLITE select unique rows Asked 6 years, 1 month ago Modified 6 years ago Viewed 5k times

  9. Make SQLite consider nulls indistinct in UNIQUE constraint

    Oct 25, 2022 · In SQLite UNIQUE constraints NULL s are distinct (source). In my use case I'd like NULL s to be indistinct for a particular UNIQUE constraint. The following example shows what …

  10. sql - Sqlite NULL and unique? - Stack Overflow

    This is actually covered in the SQLite FAQ. It is a design choice - SQLite (unlike SQL Server) chose that multiple NULL values do not count towards uniqueness in an index. The SQL …