View Single Post
Old 02-01-2013, 06:06 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,237
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
How come you didn't read the just-preceding page to the one you gave us?

http://www.w3schools.com/sql/sql_select.asp

Look at the example they give there:
SELECT LastName,FirstName FROM Persons

And then just combine that with the WHERE examples they give here:
http://www.w3schools.com/sql/sql_where.asp

In point of fact, it is usually considered *BAD PRACTICE* to use SELECT *
-- It gets all the fields for each found record, and you seldom really need all the columns
-- When working with PHP/JSP/ASP/etc. clients, it causes the client code to have to *ask* the database for all the field names and types, in order to properly interpret the results

So good queries *will* limit themselves to SELECT of only certain fields.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote