Talk:Hello World (SQL)

From LiteratePrograms
Jump to: navigation, search

68.147.200.92 wrote in an edit summary, upon changing my double-quotes to single-quotes (apostrophes):

"The original would have attempted to select a value from a field named "'Hello, World!" and failed because no such field exists"

Actually, both versions work in most SQL implementations. For example, with MySQL 5.0:

$mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.0.22-Debian_0ubuntu6.06.2-log
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql> SELECT "Hello, World!";
+---------------+
| Hello, World! |
+---------------+
| Hello, World! |
+---------------+
1 row in set (0.00 sec)
 
mysql> SELECT 'Hello, World!';
+---------------+
| Hello, World! |
+---------------+
| Hello, World! |
+---------------+
1 row in set (0.01 sec)
 
mysql> Bye
$

Still, the single-quote version is more-strictly correct, so it stays. Thanks! RossPatterson 16:56, 29 November 2006 (PST)

hijacker
hijacker
hijacker
hijacker