Hi All,
I have numbers Say from 1 to 100. (1,2,3,..25,50,51,52.......100)
In that 25 to 50 numbers are missing.
Then i have to display that record in foll format.
1-25,51-100
Can we show this in Sql.
plz give me sql query
Separate numbers in SQL (Show Max & Min)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Shivanand ArurRank #920 · 2.3K reputationPosted Oct 3, 2012, 3:39 AM EDT
Select numbers from yourTableName between 1 and 25
Select numbers from yourTableName between 51 and 100
If any query, then let me know.
Thanks
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 3, 2012, 3:48 AM EDT
I have to display the records in foll format:
Product Name Series No
ABC 1-25,51-100
PQR 200-250
XYZ 325-330
My concern is only with "Series No" Column.
Records in Table:
Name SeriesNo
ABC 1
ABC 2
PQR 200
PQR 201
.
.
My Query:
Select Name from [Table1] group By Name
But how should i display series in above format.