Discussion Locked

SQL Server

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a table I need to sort the most efficient way:

Table looks like:
Host Comp Sim
HCR 17 SCR 10,
HCR 18 SCR 8,
HCR 19 SCR 13,
HCR 21 SCR 17,
HCR 28 SCR 19,
HCR 29 SCR 22,
HCR 3 SCR 1,
HCR 30 SCR 23,
HCR 32 SCR 24,
HCR 34 SCR 28,
HCR 36 SCR 27,
HCR 39 SCR 31,
HCR 4 SCR 3,
HCR 7 SCR 6,
HF 1 HF 128, HF 48, SF 58,

I need the sort on Host to be by Bill Type and then by numerical order.

5 replies

by andrew

Maybe I'm missing something, but this may work:

Select * from Table1 ORDER BY [Bill Type],[Numerical Order]

I don't know how to match up your sort columns with the columns in the table example.

by andrew

Sorting on sub-fields within a single column.....this will not be fun.

I think the approach will have to be to parse the column, breaking it into separate columns in a temp table, then sorting that table.

You may want to consider altering the table permanently if this kind of operation will recur often.

This discussion is closed to new replies.