Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn SQLite allow me to use and .0 as the primary key on two different rows of the same table?

0
0 Posted

Why doesn SQLite allow me to use and .0 as the primary key on two different rows of the same table?

0
0

This problem occurs when your primary key is a numeric type. Change the datatype of your primary key to TEXT and it should work. Every row must have a unique primary key. For a column with a numeric type, SQLite thinks that ‘0’ and ‘0.0’ are the same value because they compare equal to one another numerically. (See the previous question.) Hence the values are not unique.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123