Find a solution to SQL query statement

Source: Internet
Author: User
Find a SQL query statement
Table Name: Archives
Field: Writer pubdate
Data format: 31,384,858,337

Writer= Author name
Pubdate= Submission Time

I need to list all the data that the author submitted for Zhang San that day, and ask for SQL query statements.
Note: Because the timestamp is purely numeric, consider whether it is necessary to format the timestamp as:%y-%m-%d%h:%i.

Share to:


------Solution--------------------
SELECT * FROM archives where Date_format (From_unixtime (pubdate), '%y-%m-%d ') =curdate () and Writer= ' Zhang San ';

------Solution--------------------
SELECT * FROM archives where writer= ' Zhang San ' and pubdate between Unix_timestamp (date) and Unix_timestamp (date (Adddate (No W (), 1)));

------Solution--------------------
SELECT * FROM archives where writer= ' Zhang San ' and pubdate between Unix_timestamp (date (now ())) and Unix_timestamp (Date (Adddate ( Now (), 1));
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.