Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/08/2012, 02:21
GeriReshef
 
Fecha de Ingreso: julio-2012
Ubicación: Israel
Mensajes: 360
Antigüedad: 11 años, 9 meses
Puntos: 40
Respuesta: ordenamiento de campos

Yo lo haría asi (utilizando el codigo de Libras):
Código SQL:
Ver original
  1. CREATE TABLE #temp
  2. (
  3. name VARCHAR(50)
  4. )
  5.  
  6. INSERT INTO #temp VALUES ('Giftcards')
  7. INSERT INTO #temp VALUES ('ABARROTES')
  8. INSERT INTO #temp VALUES ('BEBIDAS')
  9. INSERT INTO #temp VALUES ('ARTICULOS DE LIMPIEZA')
  10. INSERT INTO #temp VALUES ('ALIMENTOS Y ACCESORIOS PARA MASCOTAS')
  11. INSERT INTO #temp VALUES ('PRODUCTOS DESECHABLES Y DE PAPEL')
  12. INSERT INTO #temp VALUES ('CUIDADO PERSONAL Y COSMETICOS')
  13. INSERT INTO #temp VALUES ('TODO PARA BEBE')
  14.  
  15. SELECT  *
  16. FROM    #temp
  17. ORDER BY CASE WHEN name='Giftcards' THEN 1 ELSE 0 END,
  18.         name;
__________________
El Castellano no es mi lengua materna: discúlpenme por los errores gramaticales.
Mi blog