Skip to content

SQL: how to select distinct values with an offset

Given the following table: id value ——- ——- 0 1 1 6 2 7 3 9 4 2 5 20 6 21 7 3 I’m wondering if there’s a way to select distinct rows where there’s a difference between (integer) values of (for example) 3, giving a priority to id (low id value = more prioririty). Progr…

Sybase ASE: how to print all table rows using cursor?

The following code is supposed to print all rows contained in the temporary table #table_A: However, it results in the following error message: How can I print all rows contained in a (temporary) table? Here’s another way of putting my question: I’m trying to do something like that: Is there a way…