help me please. how to "SELECT DISTINCT" in dataeditor?

help me please. how to "SELECT DISTINCT" in dataeditor?

reru.academic3reru.academic3 Posts: 1Questions: 1Answers: 0
edited June 2018 in DataTables 1.8

' Editor::inst( $db, 'tb_table' )
' ->field(
' Field::inst('tb_table.id_group'),
' Field::inst('tb_table.subjcode'),
' Field::inst('tb_table.subjgroup'),
' Field::inst('tb_table.term'),
' Field::inst('tb_table.stu_type'),
' Field::inst('tb_subjgroup.group_tname'),
' Field::inst('tb_faculty.fac_tname'),
' Field::inst('tb_course.subjname1'),
' Field::inst('tb_stu_type.id_type'),
' Field::inst('tb_stu_type.type_name'),
' Field::inst('tb_course.crhr'),
' Field::inst('tb_program.prg_tname'),
' Field::inst('tb_table.tea_sname'),
' Field::inst('tb_table.tea_sname2'),
' Field::inst('tb_table.tea_sname3'),
' Field::inst('tb_table.time'),
' Field::inst('tb_table.time2'),
' Field::inst('tb_table.time3'),
' Field::inst('tb_table.room'),
' Field::inst('tb_table.room2'),
' Field::inst('tb_table.room3'),
' Field::inst('tb_table.homeroom')
' )
'
' ->leftJoin('tb_subjgroup','tb_table.subjgroup','=','tb_subjgroup.id_subjgroup')
' ->leftJoin('tb_stu_group','tb_table.id_group','=','tb_stu_group.id_group')
' ->leftJoin('tb_program','tb_stu_group.id_program ','=','tb_program.id_program')
' ->leftJoin('tb_faculty','tb_program.id_faculty','=','tb_faculty.id_faculty')
' ->leftJoin('tb_course','tb_table.subjcode','=','tb_course.subjcode')
' ->leftJoin('tb_stu_type','tb_stu_group.id_type','=','tb_stu_type.id_type')
' ->where( 'tb_table.term', $_POST['term'])
' ->where( 'tb_faculty.id_faculty', $_POST['facultyId'])

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Hi,

    The main editor data "fetch" doesn't have a "distinct" option since since it is expected that each row is already distinct via its primary key. If the primary key is not unique (i.e. making that row distinct) then there is no way to edit specifically that row.

    Allan

This discussion has been closed.