Android-SQLite knowledge

Source: Internet
Author: User

1. how does the SQLite database query 20th to 30 records in Table 1 select * from table1 limit 19, 11; 2. table 1 has two fields: id (primary key) and name. You need to insert a record with id = 1, name = bill into the table. If a record with id = 1 exists, the record is inserted normally. If a field with id = 1 exists, the value of the name field is updated, now you must use only one SQL statement to implement this function replace into table1 (id, name) value (1, 'bill '); 3. copy the table structure and data of table 1 TO create table table2 as select * from table1; 4. use the like clause and like functions to query the like function: select * from table1 where like ('% bill %', name); like clause: select * from table1 where name like '% bill %'; 5. SQLite supports five date and time Functions: date, time, datetime, julianday, strftime 6. the current date is 2012. The year minus 1, the month plus 1, and the output date 2011-12-01select date ('2017-11-01 ','-1 years', '+ 1 months'); 7. date Format replacement character: % d two days. If there are less than two days, fill in the first 0% f form as SS. SSS seconds, in which the last three SSS represent the hour in the millisecond % H 24 hexadecimal format % j the day of the year (001 to 366) % J Julian (Julian) on the day of www.2cto.com % m, there are two months (01-12). If there are less than two of them, add the first two points of 0% M (00 to 59 ), for less than two digits, 0% s is the second (00 to 59) from to the current second (% S), and for less than two digits, 0% weeks (0 to 6) are filled ), 0 indicates Sunday, and so on % W indicates the week (00-53) of the Year % Y (0000-9999) % percent (%) 8. SQLiteOpenHelper class Context. openOrCreateDatabase method SQLiteDatabase. openOrCreateDatabase Method

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.