brewsetr.blogg.se

Android sqlite order by asc
Android sqlite order by asc










android sqlite order by asc

Important Note:The basic difference between Like and Glob is that Glob is case-sensitive but like operator is not further Glob uses unix wildcards. sqlite> select Eno ,Ename from Employee where Ename glob 'R?v*' In following will return records as starting with ‘R’ followed by any letter after that ‘v’ than any number of letters. sqlite> select Esalary from Employee where ename glob '*t' In following example will return records with Ename ending with alphabet ‘t’. QuestionMark “?” – This represents single character. Asterisk “*” – This represents one or more characters. The wildcards are the special character which have some meaning for it. Glob clause is case_ sensitive unlike like clause. Glob clause is used to match text values against pattern using unix wildcards. sqlite> select Eno ,Ename from Employee where Ename like 'R_v%' sqlite> select Esalary from Employee where ename like '%t' Underscore “_” – This represents single character. Percentage “%” – This represents one or more characters. Like clause is used to match values using wildcards. Usage: sqlite> select Eno, Ename from Employee where Eaddress='Karnal' or Esalary=75000 Like we define a and, will be true if any of the condition either condition1, condition2 is true. With ‘OR’ clause we can define multiple conditions but it returns true if any specified conditions with it is true. Usage: sqlite> select Eno from Employee where Eaddress='Karnal' AND Įxample: EMPLOYEE TABLE Eno Ename Esalary Eaddress Like we define a and, will be true if both are condition1, condition2 are true. With ‘AND’ clause we can define multiple conditions but it turns true if all specified conditions with it stands true. These clause is used to retrieve records or you can say multiple records with the specified condition define which these two clauses. Sqlite> select name from t1 where num=102 It is used with update, select, alter.etc. Requirement – Fetch emp_name, salary, manager_id details of all employees from employee_details table in ascending order of relative position of salary column in result-set.Where clause is used to filter out the result, for that define a condition with where clause.If the specified condition is true it return the records. Scenario – Fetch rows in ascending order of a column by relative position. The query was as follows – SELECT emp_name, designation, salary, dept_id FROM employee_details Requirement – Fetch emp_name, designation, salary, dept_id details of all employees from employee_details table in ascending order of designation and descending order of salary. Scenario – Fetch rows in ascending order of a column and descending order of another column. The query was as follows – SELECT emp_name, designation, dept_id FROM employee_details Requirement – Fetch emp_name, designation, dept_id details of all employees from employee table in ascending order of designation and dept_id.

android sqlite order by asc

Scenario – Fetch rows in ascending order using multiple columns. The query was as follows – SELECT emp_name, designation FROM employee_detailsīy executing above query, we can get results as shown below – emp_name Requirement – Fetch emp_name, designation details of all employees from employee table in ascending order of designation. Scenario – Fetch rows in ascending order using column.












Android sqlite order by asc