Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Wildcards

September 13, 1998

As in most languages, SQL provides a set of wildcards that are used as shortcuts to represent whole categories of values. For example, oftentimes, you may want all the data for the columns in your table but you don't want to write all the column names in a comma-delimited list.

To make such queries more efficient, SQL provides the "*" wildcard that specifies "ALL" of something. For example, to select all the columns in the PRODUCTS table, we would use:

     SELECT * 
     FROM PRODUCTS;

The database would then respond with:

P_NUM	P_QUANTITY	P_PRICE
-------------------------------
001	104	 	 99.99
002	12		865.99
003	2000   		 50.00
-------------------------------

Of course you could achieve the same results (with more work) using:

     SELECT P_NUM, P_QUANTITY, P_PRICE 
     FROM PRODUCTS;