SQLite comparisons are based on different values and are not based on the field type, because SQLite is a weakly typed field

Source: Internet
Author: User
Tags sqlite

SQLite comparisons are different based on different values, not depending on the field type, because SQLite is a weakly typed field  --------------------------------------------------http ://www.sqlite.com.cn/mysqlite/5/127.html  in version SQLite3.0, the value is defined why the type is only related to the value itself, has no relation to the column, and is not related to the variable. (This is sometimes referred to as a weak type.) All the other database engines we use are constrained by the static type system, where the classes of all values are determined by the properties of the column they belong to, and the value-independent .  to maximize the compatibility of SQLite databases and other databases, SQLite supports column "type affinity". The affinity of a column is to suggest a type for the data stored in the column. We should pay attention to suggestions rather than coercion. In theory, any column can still store any type of data. For some columns only, the database will be stored as the recommended type if it is given the recommended type. This preferred data type is referred to as the "affinity type" .  ------------------------------------------- -------when grouping values and the When grouping values with a GROUP BY clause, a value with different storage types is considered different, but there are exceptions, such as an integer value and a real value that are equal from a digital point of view. Then they are equal. When the GROUP BY clause is compared, the value does not have any affinity . --------------------------------------------------pay special attention to the SQLite document that explains the   BLOB text is a literal value that begins with a "x" or "X" that contains hexadecimal text information. For example:     X ' 53514697465 '   "that is" BLOB literals is string literals containing hexadecimal data and preceded B Y a single "x" or "X" character. For example:     X ' 53514c697465 '   '   here is a binary content written so that the string written is notwith "=" selected, for example  insert into Appzfdata (ID) VALUES (x ' 3131 ') insert into Appzfdata (ID) VALUES (' one ')   if using a statement select   SELECT * From appzfdata WHERE id = ' 11 ' is not the first one to choose (regardless of what type of field the ID is used for when creating the table). But you use the management tool software to see the two records of the ID value is "11" If you do not know, you will be very Crazy. I think this is a very serious problem, how do I know what type of data is stored in the?   instead of the "=" number, it can be taken out.  /*
Select Length (ID), X ' t,* from Appzfdata--where id like "1"

--and t = X ' 31 '

where id = X ' 313100 ' or id = '--select ' (' AAA ' | | ID) | | ' AAA ', * from Appzfprice where [appname] LIKE ' i1 ' select Length (appname), * from Appzfprice where [appname] LIKE ' i1 ' * *

SELECT * FROM t2 where id = ' 1 '

Http://www.cnblogs.com/-clq/p/3326407.html

SQLite comparisons are based on different values and are not based on the field type, because SQLite is a weakly typed field

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.