Home > database >  For help, want to query the time limit for the 2019-06-29 and 2019-06-29, should be how to write
For help, want to query the time limit for the 2019-06-29 and 2019-06-29, should be how to write

Time:09-17

Statement

SELECT
*
The FROM
(SELECT
B.t eam_id AS 'team id,
Dr. Id AS 'project id,
A.t id AS 'task id,
A.u id AS 'share person id',
Arjun ark_uid AS 'people id to solve the problem,
A.a mount AS 'subject amount,
A. ` desc ` AS 'task name,
From_unixtime (time, "Y - m - % d % %") AS 'time'
The FROM
Tb_totoro_task_share_settlement AS a,
Tb_team_account_online AS b
WHERE
A.u id=b.u id
) AS the total
WHERE
'time' & gt;=UNIX_TIMESTAMP (' 2019-06-29 ')
AND
'time' & lt; UNIX_TIMESTAMP (' 2019-10-15 ')
]

Look not to come out as a result, which help to look at,

CodePudding user response:


SELECT
*
The FROM
(SELECT
B.t eam_id AS 'team id,
Dr. Id AS 'project id,
A.t id AS 'task id,
A.u id AS 'share person id',
Arjun ark_uid AS 'people id to solve the problem,
A.a mount AS 'subject amount,
A. ` desc ` AS 'task name,
A.t ime
The FROM
Tb_totoro_task_share_settlement AS a,
Tb_team_account_online AS b
WHERE
A.u id=b.u id
) AS the total
WHERE
Time & gt; 1569859200
AND
Time & lt; 1571068800
]
This statement can be found out at this moment, but was the timestamp format, how to modify the statement can directly display the date of the data form?

CodePudding user response:

SELECT
B.t eam_id AS 'team id,
Dr. Id AS 'project id,
A.t id AS 'task id,
A.u id AS 'share person id',
Arjun ark_uid AS 'people id to solve the problem,
A.a mount AS 'subject amount,
A. ` desc ` AS 'task name,
FROM_UNIXTIME (a.t ime, "Y - m - % d % %") AS 'time'
The FROM
Tb_totoro_task_share_settlement AS a,
Tb_team_account_online AS b
WHERE
A.u id=b.u id
AND FROM_UNIXTIME (a.t ime, "Y - m - % d % %") & gt;
='2019-06-29'AND FROM_UNIXTIME (a.t ime, "Y - m - % d % %") & lt; '2019-10-15'

CodePudding user response:

refer to the second floor weixin_40897993 response:
SELECT
B.t eam_id AS 'team id,
Dr. Id AS 'project id,
A.t id AS 'task id,
A.u id AS 'share person id',
Arjun ark_uid AS 'people id to solve the problem,
A.a mount AS 'subject amount,
A. ` desc ` AS 'task name,
FROM_UNIXTIME (a.t ime, "Y - m - % d % %") AS 'time'
The FROM
Tb_totoro_task_share_settlement AS a,
Tb_team_account_online AS b
WHERE
A.u id=b.u id
AND FROM_UNIXTIME (a.t ime, "Y - m - % d % %") & gt;
='2019-06-29'AND FROM_UNIXTIME (a.t ime, "Y - m - % d % %") & lt; '2019-10-15'
thank you!
  • Related