i have this query which give me this table:
SELECT
CS.Name,
CS.FirstStep,
--CSS.NextCAPAStepID,
CS.ID
FROM CAPA_STEP_SEQUENCE CSS
LEFT JOIN CAPA_STEP CS ON CS.ID = CSS.CAPAStepID
WHERE CAPAStepID in (100000009,100000010,100000011,100000012,100000013)
GROUP BY CS.Name, CS.ID, CS.FirstStep
ORDER BY CS.FirstStep DESC
I heave to sort this table by this column from another table:
SELECT NextCAPAStepID
FROM CAPA_STEP_SEQUENCE
WHERE CAPAStepID in (100000009,100000010,100000011,100000012,100000013)
When i try to order by first query by CSS.NexstCAPAStepID it makes that in the first order column NextCAPAStepID is sorted ASC and then whole table is sorted with this sequence but in my case i want to sort whole table by sequence from CSS.NextCAPAStepID. Notice also that row with value 1 in column FirstStep should be always in the top.
Aucun commentaire:
Enregistrer un commentaire