Search code examples
mysqlgoogle-sheetsgoogle-sheets-formulagoogle-sheets-querygoogle-query-language

How do I select rows, order by date desc in Google Sheets?


I have column A as ID , column B as Score and column C as Date in Google Sheet and I wanted to select the data and ORDER by column C DESC.

The result come out as below:

A   B   C
123 100 30/07/19
111 100 30/07/19
113 100 29/07/19
112 100 28/07/19
115 100 02/08/19
016 100 01/08/19

The result should be:

115 100 02/08/19
016 100 01/08/19
123 100 30/07/19
111 100 30/07/19
113 100 29/07/19
112 100 28/07/19

How can I solve this with SQL in Google Sheet?

Select A,B,C Where B LIKE '% 100 &%' Order By C DESC

Solution

  • it's a formatting issue... format column A as Plain Text, column B as Number and column C as Date. then use this formula:

    =QUERY(A2:C, "select A,B,C where B = 100 order by C desc", 0)
    

    0