This SQL query selects the distinct department code from the mampg_prmast table by truncating the mampg_prno field divided by either 100,000 if it is 8 characters long, 100,000 if it is 7 characters long, or 10,000 if it is another length. It then orders the results by the department code field.
This SQL query selects the distinct department code from the mampg_prmast table by truncating the mampg_prno field divided by either 100,000 if it is 8 characters long, 100,000 if it is 7 characters long, or 10,000 if it is another length. It then orders the results by the department code field.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
This SQL query selects the distinct department code from the mampg_prmast table by truncating the mampg_prno field divided by either 100,000 if it is 8 characters long, 100,000 if it is 7 characters long, or 10,000 if it is another length. It then orders the results by the department code field.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
select distinct decode(length(mampg_prno),8,trunc(mampg_prno/100000),7, trunc(mampg_prno/100000), trunc(mampg_prno/10000)) dptcd from mampg_prmast order by 1 /