Monday, 18 June 2012

Lesson 5: Retrieving a Single Column in SQL


You can use SQL to retrieve a single column of data.


Syntax:
Select fieldname
from tablename;

Explanation:
  • Instead of an asterisk, the name of the field is specified in the Select clause. 
  • Field names are not case-sensitive. You can type field names in uppercase or lowercase letters.
Example:Retrieve the vendor name from each record:
  1. In the SQL text box, type:
Select Name
from TrnVendor;
  1. Click on First, the Run button located to the right of the SQL text box. The results will display on the screen.
  2. Use the vertical scroll bar to move up and down the screen.
  3. Click on Stop to return to the original screen.
Results:
Name
Wet Off Towels
The Games All Here
BedMakers Linen
Bed Room Furniture, Inc.
Ray Block
Mosquito No Bite
Spot Out

No comments:

Post a Comment