How To Select Some Columns from a Table

Q

How To Select Some Columns from a Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY

✍: FYIcenter.com

A

If you want explicitly tell the query to return some columns, you can specify the column names in the SELECT clause. The following select statement returns only two columns, "id" and "url" from the table "fyi_links":

mysql> SELECT id, url FROM fyi_links;
+-----+-------------------+
| id  | url               |
+-----+-------------------+
| 101 | dev.fyicenter.com |
| 102 | dba.fyicenter.com |
| 103 | sqa.fyicenter.com |
+-----+-------------------+
3 rows in set (0.00 sec)

2007-05-11, 4379👍, 0💬