我有Dates Table,其中一个字段名称是START_DATE(DATE)类型
我的查询是:
SELECT UNIX_TIMESTAMP(SELECT START_DATE FROM `mobile_registrations_dates` WHERE SNO=1)
我使用了SNO = 1,因为我只想获取一个UnixTimeStamp值,但上面的查询给出了如下错误
**Error**
SQL query: 
SELECT UNIX_TIMESTAMP(SELECT START_DATE FROM `mobile_registrations_dates` WHERE LIMIT 1) LIMIT 0, 25
MySQL said: 
#1064 - 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 'SELECT START_DATE FROM `mobile_registrations_dates` WHERE LIMIT 1)
LIMIT 0, 25' at line 1
答案 0 :(得分:1)
我使用了这个查询 -
而不是嵌套查询SELECT UNIX_TIMESTAMP(START_DATE) FROM `mobile_registrations_dates` WHERE SNO = 1