![]() ![]() We will use the customers table in the sample database for demonstration. In database theory, if a column contains NULL values, it means that we do not have the information about that column of particular records or the information is not applicable.įor example, if a customer has a phone number with a NULL value, it means we don’t have information about the phone number of the customer at the time of recording customer information or the customer may not have a phone number at all. If you use the DISTINCT clause with a column that has NULL values, SQLite will keep one row of a NULL value. SQLite considers NULL values as duplicates. In case you use multiple columns, SQLite uses the combination of values in these columns to evaluate the duplicate. If you use one column, SQLite uses values in that column to evaluate the duplicate. Second, you place a column or a list of columns after the DISTINCT keyword.First, the DISTINCT clause must appear immediately after the SELECT keyword.The following statement illustrates the syntax of the DISTINCT clause: SELECT DISTINCT select_listįROM table Code language: SQL (Structured Query Language) ( sql ) The DISTINCT clause allows you to remove the duplicate rows in the result set. The DISTINCT clause is an optional clause of the SELECT statement. Introduction to SQLite SELECT DISTINCT clause ![]() Summary: in this tutorial, you will learn how to use the SQLite SELECT DISTINCT clause to remove duplicate rows in the result set.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |