Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
SQL
(view source)
Revision as of 15:14, March 9, 2017
683 bytes added
,
15:14, March 9, 2017
added an extended example
Line 26:
Line 26:
Whoever customer 15 is, their account has just been deleted.
Whoever customer 15 is, their account has just been deleted.
+
===Select===
+
As a further example, suppose a database contains only the following table:
+
{| class="wikitable"
+
|-
+
! customer_id !! last_name !! first_name !! city
+
|-
+
| 10039 || Smith || John || Huston
+
|-
+
| 10178 || Cole || Christen || Wortham
+
|-
+
| 10052 || Franks || Andrew || Austin
+
|-
+
| 10131 || Klinfelt || Mark || Thornberry
+
|-
+
| 10014 || Franklin || Mary || Austin
+
|}
+
If the following query is run:
+
<pre>
+
SELECT *
+
FROM customers
+
WHERE city = 'Austin'
+
ORDER BY last_name ASC;
+
</pre>
+
+
then these results would be returned:
+
{| class="wikitable"
+
|-
+
! customer_id !! last_name !! first_name !! city
+
|-
+
| 10014 || Franklin || Mary || Austin
+
|-
+
| 10052 || Franks || Andrew || Austin
+
|}
==References==
==References==
<references/>
<references/>
[[Category:Programming Languages]]
[[Category:Programming Languages]]
DavidB4
Block, SkipCaptcha, Upload,
Automoderated users
,
Check users
, delete, edit,
Moderators
, move, oversight, protect, ratelimit-exempt, rollback,
Administrators
20,330
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Article
talk page
Variants
Views
Read
View source
View history
More
Search
Popular Links
Main Page
Recent changes
New Pages
Random page
Statistics
Edit Console
Special pages
Printable version