Open AlfieriChou opened 2 years ago
select
`date`,
from_unixtime(`date` / 1000, '%Y-%c-%d') as `date_str`
from
`test`
where
`date` = 1652025600000
UPDATE `test` SET `address` = TRIM(BOTH '"' FROM `address`)
update
`test`
set
`amount` = JSON_EXTRACT(extra, '$. amount')
where
`id` = 1
update
`test`
set
`address` = TRIM(BOTH '"' FROM JSON_EXTRACT(extra, '$. address'))
where
`id` = 1
且
查询select
`account_id`
from
`account_tag`
where
`tag_id` in (33, 82)
group by
`account_id`
having
count(distinct `tag_id`) = 2
select
id,
created_at_str,
date_str,
datediff(created_at_str, date_str) as diff_day
from
(
SELECT
id,
FROM_UNIXTIME(
t_table.created_at / 1000
) as created_at_str,
FROM_UNIXTIME(
t_table.date / 1000 + 86400 * 3
) as date_str
FROM
t_table
WHERE
id = '11111111111'
) as temp