List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:August 29 2005 6:07am
Subject:Re: why is this not an error?
View as plain text  
In the last episode (Aug 29), Jason Pyeron said:
> Why is this not an error? 
> 
> mysql> select count(*) paths;
> +-------+
> | paths |
> +-------+
> |     0 |
> +-------+
> 1 row in set (0.00 sec)

Why should it be?  You've simply omitted the optional AS keyword in a
standard no-table SELECT query.  There's no table in the query, so
count(*) returns 0 (I suppose you could argue it should return NULL),
and you've renamed the column, so that's why MySQL calls it "paths" in
the output.

It's no different from 

SELECT version() v;
+--------+
| v      |
+--------+
| 4.1.12 |
+--------+
1 row in set (0.00 sec)

-- 
	Dan Nelson
	dnelson@stripped
Thread
why is this not an error?Jason Pyeron29 Aug
  • Re: why is this not an error?Dan Nelson29 Aug
Re: why is this not an error?Chris29 Aug
  • Re: why is this not an error?Jason Pyeron29 Aug