Access SQL query select with a specific pattern -


i want select each 5 rows unique , select pattern applies rest of result (i.e if result contains 10 records expecting have 2 set of 5 unique rows)

example:

  • what have:
    • 1
    • 1
    • 5
    • 3
    • 4
    • 5
    • 2
    • 4
    • 2
    • 3
  • result want achieve:
    • 1
    • 2
    • 3
    • 4
    • 5
    • 1
    • 2
    • 3
    • 4
    • 5

i have tried , searched lot couldn't find close want achieve.

assuming can somehow order rows within sets of 5:

select  t.row % 5, t.row #t t order  t.row , t.row % 5 

we closer truth more details data looks , you're trying do.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -