Explain this queryRSS

1 reply

Last post Mar 08, 2018 12:06 PM by Rovastar

  • Explain this query

    Mar 07, 2018 11:39 AM|hg363|LINK

    Can any one please tell me in lay man terms, what the following query does

    SELECT TOP 20 EXTRACT_FILENAME(Path), EXTRACT_PATH(Path), DIV(Size, 1048576), LastWriteTime FROM c:\*.* WHERE LastWriteTime < SUB(TO_LOCALTIME(SYSTEM_TIMESTAMP()), TIMESTAMP('0001', 'yyyy')) ORDER BY DIV(Size, 1048576) DESC

    AND what does this mean

    TIMESTAMP('0001', 'yyyy')

    AND what does this mean

    DIV(Size, 1048576)

  • Rovastar Rovastar

    5482 Posts

    MVP

    Moderator

    Re: Explain this query

    Mar 08, 2018 12:06 PM|Rovastar|LINK

    I guess
    TIMESTAMP('0001', 'yyyy')
    Returns the year

    And
    DIV(Size, 1048576)

    Converts from bytes into megabytes.
    Troubleshoot IIS in style
    https://www.leansentry.com/