|
 |
|
รบกวนครับ คำสั่ง select ขอคำสั่งselect ข้อมูลที่พี่งมาใหม่ค๊ะ ไม่ทราบว่าต้องเขียนยังไงค๊ะ |
|
 |
|
|
 |
 |
|
select * from db order by desc
|
 |
 |
 |
 |
Date :
2009-08-23 03:38:35 |
By :
amazing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
select * from db order by id desc limite 0,5
เอามาห้าแถวสุดท้ายที่ป้อน
|
 |
 |
 |
 |
Date :
2009-08-23 04:21:46 |
By :
amazing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT
[ALL | DISTINCT | DISTINCTROW ]
[HIGH_PRIORITY]
[STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
select_expr [, select_expr ...]
[FROM table_references
[WHERE where_condition]
[GROUP BY {col_name | expr | position}
[ASC | DESC], ... [WITH ROLLUP]]
[HAVING where_condition]
[ORDER BY {col_name | expr | position}
[ASC | DESC], ...]
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
[PROCEDURE procedure_name(argument_list)]
[INTO OUTFILE 'file_name' export_options
| INTO DUMPFILE 'file_name'
| INTO var_name [, var_name]]
[FOR UPDATE | LOCK IN SHARE MODE]]
อันนี้เป็น Format ของการ Select นะครับ
หรือเอาง่าย ๆ ก็คือ
Select ชื่อColumns ต่าง ๆ
From ชื่อ Table
Where เงื่อนไขที่เราต้องการ
ส่วนเรื่องอะไรที่เพิ่มเติมจากนี้ ให้ไปอ่านเพิ่มเติมได้ที่
http://dev.mysql.com/doc/refman/5.0/en/select.html
|
 |
 |
 |
 |
Date :
2009-08-24 08:15:08 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT LAST_INSERT_ID();
สำหรับเอาค่า auto_increment ล่าสุดที่ถูก insert เข้าไปครับ
|
 |
 |
 |
 |
Date :
2009-08-24 08:41:00 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
select * from ชื่อตาราง
|
 |
 |
 |
 |
Date :
2009-08-24 13:36:52 |
By :
ariya99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|