[EMAIL PROTECTED] wrote on 26/04/2005 14:46:37:

> Hello,
> 
> I have a big problem, I only want to check if it's the minute 45 
> currently.
> 
> I want to make a virtual SELECT without tables:
> 
> mysql> SELECT MINUTE(CURRENT_TIMESTAMP()) WHERE 
> MINUTE(CURRENT_TIMESTAMP()) = 45;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the 
> manual that corresponds to your MySQL server version for the right 
> syntax to use near 'WHERE MINUTE(CURRENT_TIMESTAMP()) = 45' at line 1
> mysql> 
> 
> It works only when I put a FROM with an existing table on it.
> Is there a solution to do it without FROM or to use a virtual table?

What response do you want, exactly?

Try either of the two formulations below, depending upon whether you want 
to know what the minute is, or just whether or not it is 45 (returns 1 if 
it is).

mysql> select minute(now()) ;
+---------------+
| minute(now()) |
+---------------+
|            58 |
+---------------+
1 row in set (0.06 sec)

mysql> select minute(now()) = 45 ;
+--------------------+
| minute(now()) = 45 |
+--------------------+
|                  0 |
+--------------------+
1 row in set (0.00 sec)


  Alec

 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to