1

I have this table:

    Name   | Weight | Color
1   Cherry | 1      | Red
2   Apple  | 4      | Green
3   Pear   | 3      | Yellow

I need a view in which only the top row is visible

Cherry | 1 | Red

When the table changes (new record, sorting), the view changes accordingly

Example 1:

    Name   | Weight V| Color
1   Apple  | 4       | Green
2   Pear   | 3       | Yellow
3   Cherry | 1       | Red

single row view:

Apple | 4 | Green

Example 2:

    Name   | Weight  | Color
1   Almond | 0.5     | Brown
2   Apple  | 4       | Green
3   Pear   | 3       | Yellow
4   Cherry | 1       | Red

single row view:

Almond | 0.5 | Brown

This doesn't seem possible. Didn't find anything in related forums.

GPT3 suggestions were selecting a record by row_id or time_of_creation fields, but this won't help with table resorting.

It also suggested using SELECT(table_name, {}, {limit: N, fields: ["field_1", "field_2"]}) - but limit does not work. Same for FIRST() which doesn't exist.

Any solution to this?

Roy
  • 1,307
  • 1
  • 13
  • 29

1 Answers1

2

Try a record list. You can sort elements there as well as limit how many you want to list.

I guess the other would be scripting and just "limiting" what the query returns when displaying it (which doesn't sound like what you want). I am not sure there is a simple native way.

I guess in the end record list limits are the closest to what you are trying to achieve, especially since your main criterion for a top row is sorting.

TheNomad
  • 892
  • 5
  • 6