locked
Explain this query RRS feed

  • Question

  • User1504639868 posted

    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)

    Wednesday, March 7, 2018 11:39 AM

All replies

  • User-2064283741 posted
    I guess
    TIMESTAMP('0001', 'yyyy')
    Returns the year

    And
    DIV(Size, 1048576)

    Converts from bytes into megabytes.
    Thursday, March 8, 2018 12:06 PM