有两个数据表:
xty: dict:
serv_stat dict_id dict_name
--------- -------------------
虚占 001 释放
总量 010 实占
001 。 。
010 。 。
。 。 。
。 。 。
。 。 。
。 。 。
。 。 。现在想使xty这样显示:serv_stat如果是虚占或者总量,就直接显示虚占或总量,如果是数字,就要显示DICT表中对应DICT_ID 的DICT_NAME,请指教应该怎么做,我现在只能显示这样:
select b.dict_name as sere_stat from xty a,dict b where a.serv_stat = b.dict_id;
xty:
serv_stat
---------
释放
实占希望的结果是这样的:
xty:
serv_stat:
---------
虚占
总量
释放
实占
。
。
。
。我用的是oracle,请大家教教我该怎么做
xty: dict:
serv_stat dict_id dict_name
--------- -------------------
虚占 001 释放
总量 010 实占
001 。 。
010 。 。
。 。 。
。 。 。
。 。 。
。 。 。
。 。 。现在想使xty这样显示:serv_stat如果是虚占或者总量,就直接显示虚占或总量,如果是数字,就要显示DICT表中对应DICT_ID 的DICT_NAME,请指教应该怎么做,我现在只能显示这样:
select b.dict_name as sere_stat from xty a,dict b where a.serv_stat = b.dict_id;
xty:
serv_stat
---------
释放
实占希望的结果是这样的:
xty:
serv_stat:
---------
虚占
总量
释放
实占
。
。
。
。我用的是oracle,请大家教教我该怎么做
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货