Bhavesh Vankar

Bhavesh Vankar

  • 731
  • 1.1k
  • 78.6k

how to display extra department name with department id in stored tab

Feb 22 2022 12:13 PM

i have below sql query wich is display department name i combobox from table. but i want to display some more department name but don't want to store that department name in table.

i have done it but when i try to add more than one name it generate error... kindly help me what should i do...?

 i have display one department without store in table is 

10000 OTHER 

Now i want to display more department name without store in table

like

10001 OTHER 2

10003 OTHER 3

10004 OTHER 4

SELECT EMP_MASTER.DEPTID,DEPTNAME FROM EMP_MASTER INNER JOIN 
dept_cmp_master ON dept_cmp.deptid=EMP_MASTER.DEPTID WHERE dept_emp.emp_flg='p' 
Union SELECT  10000,'OTHER' as DEPTNAME from EMP_MASTER ORDER BY EMP_MASTER.DEPTNAME ASC

 


Answers (2)