SQL - Order by with alphanumeric characters
问题 I have the following table: create table #tbl ( product_id nvarchar(50) ) insert into #tbl values ('011014-A11') insert into #tbl values ('011014-A10') insert into #tbl values ('011014') insert into #tbl values ('011014-A1') insert into #tbl values ('011014-A2') I want to order the Product IDs like this (from the smallest to the greatest): 011014 011014-A1 011014-A2 011014-A10 011014-A11 This is what I tried, but it is not working: select product_id from #tbl order by product_id desc How do I