How to output a debugging message in MySQL?

select concat ("Updated ", row_count(), " rows") as '';
#DATE(DATE_SUB(NOW(), INTERVAL ROUND(RAND(1)*10) DAY));
select concat ("Random date: ", DATE(DATE_SUB(NOW(), INTERVAL ROUND(RAND(1)*100) DAY))) as '';

Examples

Output a random date:

select addtime(concat_ws(' ','1964-12-25' + interval rand()*20000 day ,'00:00:00'),sec_to_time(floor(0 + (rand() * 86401)))) as '';

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>