nicolazerty a écrit :il faut créer un table "importance"
importance(id,libelle,rang)
et comme ca tu fais le tri sur le rang de l'importance liée à ton évenement
"SELECT 1 AS CodeTri,* FROM evenements WHERE 'import' LIKE 'Tr%'
UNION ALL
SELECT 2 AS CodeTri,* FROM evenements WHERE 'import' LIKE 'El%'
UNION ALL
SELECT 3 AS CodeTri,* FROM evenements WHERE 'import' LIKE 'No%'
UNION ALL
SELECT 4 AS CodeTri,* FROM evenements WHERE 'import' LIKE 'Fa%'
UNION ALL
ORDER BY CodeTri DESC"
(mais elle marche po!)
Avec ta solution je ne voie pas comment je peux faire correspondre les 'Id' avec les bons import (rang)?
SELECT 1 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Tr%'
UNION ALL
SELECT 2 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'El%'
UNION ALL
SELECT 3 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'No%'
UNION ALL
SELECT 4 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Fa%'
ORDER BY CodeTri DESC
SELECT 1 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Tr%'
UNION ALL
SELECT 2 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'El%'
UNION ALL
SELECT 3 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'No%'
UNION ALL
SELECT 4 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Fa%'
ORDER BY CodeTri DESC
t'as juste à rajouter un champ importance a ta table evenements
SELECT 1 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Tr%'
UNION ALL
SELECT 2 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'El%'
UNION ALL
SELECT 3 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'No%'
UNION ALL
SELECT 4 AS CodeTri, import, id
FROM evenements
WHERE import
LIKE 'Fa%'
ORDER BY CodeTri DESC
PS : Merci quand même Nico!
oh my god !!! J'ai failli perdre la vue.
Moi je vote pour la solution nico, autant faire un truc propre dès le début.