SELECT FROM table_nameWHERE column LIKE 'XXXX%'or SELECT FROM table_nameWHERE column LIKE '%XXXX%'orSELECT FROM table_nameWHERE column LIKE 'XXXX_'orSELECT FROM table_nameWHERE column LIKE '_XXXX'orSELECT FROM table_nameWHERE column LIKE '_XXXX_'
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0
sqlite> SELECT * FROM COMPANY WHERE AGE LIKE '2%';
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------2 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0
SELECT FROM table_nameWHERE column GLOB 'XXXX*'or SELECT FROM table_nameWHERE column GLOB '*XXXX*'orSELECT FROM table_nameWHERE column GLOB 'XXXX?'orSELECT FROM table_nameWHERE column GLOB '?XXXX'orSELECT FROM table_nameWHERE column GLOB '?XXXX?'orSELECT FROM table_nameWHERE column GLOB '????'
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0
sqlite> SELECT * FROM COMPANY WHERE AGE GLOB '2*';
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------2 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0
SELECT column1, column2, columnN FROM table_nameLIMIT [no of rows]
SELECT column1, column2, columnN FROM table_nameLIMIT [no of rows] OFFSET [row num]
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0
sqlite> SELECT * FROM COMPANY LIMIT 6;
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.0
sqlite> SELECT * FROM COMPANY LIMIT 3 OFFSET 2;
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------3 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.0
SELECT DISTINCT column1, column2,.....columnN FROM table_nameWHERE [condition]
ID NAME AGE ADDRESS SALARY---------- ---------- ---------- ---------- ----------1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.08 Paul 24 Houston 20000.09 James 44 Norway 5000.010 James 45 Texas 5000.0
sqlite> SELECT name FROM COMPANY;
NAME----------PaulAllenTeddyMarkDavidKimJamesPaulJamesJames
sqlite> SELECT DISTINCT name FROM COMPANY;
NAME----------PaulAllenTeddyMarkDavidKimJames
Nguồn tin: vncoder.vn
Những tin mới hơn
Những tin cũ hơn
- Click vào nút hiển thị ngày trong tuần hoặc tháng âm lịch để xem chi tiết
- Màu đỏ: Ngày tốt
- Xanh lá: Đầu tháng âm lịch
- Màu vàng: Ngày hiện tại