ALIGNING, ALL RANKS OF THE DAY OF THE WEEK,
WHEN YOU COME IN A SELECT DEGRADED


My explanation is

THE TABLE OF CLASS TEACHING SESSION


CREATE TABLE SESIONPROGRAMA
(
ID_SESIONPROG Integer NOT NULL,--ID SESSION CLASSES
ID_PSP Varchar(10) NOT NULL, -- ID TEACHER
ID_MODSIG Varchar(6) NOT NULL, --
ID_GPOPER Varchar(9) NOT NULL, -- GROUP
SP_DIA_PROG Varchar(10) NOT NULL, - DAY OF WEEK
SP_HRENT Time, -- CLASS HOURS ENTRY
SP_HRSAL Time, -- OUT OF SCHOOL HOURS

CONSTRAINT PK_SESIONPROGRAMA_1 PRIMARY KEY (ID_SESIONPROG)
);


OK



DATA CAPTURE FOR A GROUP

ID_SESI-ID_PSP - ID_MODSIG -- ID_GPOPER -SP_DIA_PROG- SP_HRENT - SP_HRSAL
575 5302430001 MAMAU0 208094202 LUNES 18:00:00.000 20:00:00.000
576 5302430001 MAMAU0 208094202 MARTES 18:00:00.000 20:00:00.000
694 5302430001 MAMAU0 208094202 VIERNES 18:00:00.000 20:00:00.000
582 5302430007 ESPA30 208094202 MARTES 13:00:00.000 14:00:00.000
584 5302430007 ESPA30 208094202 MIERCOLES 13:00:00.000 14:00:00.000
692 5302430007 ESPA30 208094202 LUNES 13:00:00.000 14:00:00.000
580 5302430017 FISI20 208094202 JUEVES 13:00:00.000 15:00:00.000
581 5302430017 FISI20 208094202 VIERNES 13:00:00.000 15:00:00.000
570 5302430018 COEMI0 208094202 LUNES 14:00:00.000 16:00:00.000
571 5302430018 COEMI0 208094202 MARTES 14:00:00.000 16:00:00.000
572 5302430018 COEMI0 208094202 MIERCOLES 14:00:00.000 16:00:00.000
567 5302430019 AFMINY 208094202 MARTES 16:00:00.000 18:00:00.000
568 5302430019 AFMINY 208094202 MIERCOLES 17:00:00.000 20:00:00.000
569 5302430019 AFMINY 208094202 VIERNES 17:00:00.000 18:00:00.000
585 5302430027 TUTO40 208094202 MIERCOLES 16:00:00.000 17:00:00.000
578 5302430036 MATE40 208094202 JUEVES 15:00:00.000 17:00:00.000
693 5302430036 MATE40 208094202 VIERNES 15:00:00.000 17:00:00.000
573 5302430046 APIAU0 208094202 LUNES 16:00:00.000 18:00:00.000
574 5302430046 APIAU0 208094202 JUEVES 17:00:00.000 20:00:00.000


GREAT TO HERE


SELECT START:
(case a.SP_DIA_PROG when 'MARTES' THEN (a.SP_HRENT || '-'|| a.SP_HRSAL) END) AS MARTES,
(case a.SP_DIA_PROG when 'MIERCOLES' THEN (a.SP_HRENT || '-'|| a.SP_HRSAL) END) AS MIERCOLES,
(case a.SP_DIA_PROG when 'JUEVES' THEN (a.SP_HRENT || '-'|| a.SP_HRSAL) END) AS JUEVES,
(case a.SP_DIA_PROG when 'VIERNES' THEN (a.SP_HRENT || '-'|| a.SP_HRSAL) END) AS VIERNES,
(case a.SP_DIA_PROG when 'SABADO' THEN (a.SP_HRENT || '-'|| a.SP_HRSAL) END) AS SABADO
FROM SESIONPROGRAMA a WHERE A.ID_GPOPER='208094202' ORDER BY A.ID_PSP


THE RESULT IS:

VERY GOOD
ID_PSP ID_MODSIG MONDAY TUES WEDNES THURS FRIDAY SATURDAY

5302430001 MAMAU0 18:00-20:00 [null] [null] [null] [null] [null]
5302430001 MAMAU0 [null] 18:00-20:00 [null] [null] [null] [null]
5302430001 MAMAU0 [null] [null] [null] [null] 18:00-20:00 [null]
5302430007 ESPA30 [null] 13:00-14:00 [null] [null] [null] [null]
5302430007 ESPA30 [null] [null] 13:00-14:00 [null] [null] [null]
5302430007 ESPA30 13:00-14:00 [null] [null] [null] [null] [null]
5302430017 FISI20 [null] [null] [null] 13:00-15:00[null] [null]
5302430017 FISI20 [null] [null] [null] [null] 13:00-15:00 [null]
5302430018 COEMI0 14:00-16:00 [null] [null] [null] [null] [null]
5302430018 COEMI0 [null] 14:00-16:00 [null] [null] [null] [null]
5302430018 COEMI0 [null] [null] 14:00-16:00 [null] [null] [null]
5302430019 AFMINY [null] 16:00-18:00 [null] [null] [null] [null]
5302430019 AFMINY [null] [null] 17:00-20:00 [null] [null] [null]
5302430019 AFMINY [null] [null] [null] [null] 17:00-18:00 [null]
5302430027 TUTO40 [null] [null] 16:00-17:00 [null] [null] [null]
5302430036 MATE40 [null] [null] [null] 15:00-17:00[null] [null]
5302430036 MATE40 [null] [null] [null] [null] 15:00-17:00 [null]
5302430046 APIAU0 16:00-18:00 [null] [null] [null] [null] [null]
5302430046 APIAU0 [null] [null] [null] 17:00-20:00[null] [null]


ALIGN EVERY POSSIBLE ID_PSP.

EXAMPLE

5302430001 MAMAU0 18:00-20:00 18:00-20:00 [null] [null] 18:00-20:00 [null]
5302430007 ESPA30 13:00-14:00 13:00-14:00 13:00-14:00 [null] [null] [null]
...
....
....
....


IF POSSIBLE SOLUTION SELECT;
O
IN ANOTHER PROGRAMMABLE

THANKS FOR YOUR GREAT HELP