Code not working

I can not figure out why the following code will not run. Please help.

select

exp_dt, 
eff_dt,
lp_reg_nbr,
lp_rar_reg_area_cd,
rdy_rnt_agr_nbr,
erac_rnt_agr_nbr

from ody.VHCL_MVS m
inner join ody.VHCL_PLT_HIST p on p.vhc_vhcl_unit_nbr=m.vhcl_vhcl_unit_nbr
where rdy_rnt_agr_nbr = '148685886'

August 27th, 2015 5:03pm

You need to specify the columns from which table, i.e.,

SELECT m.exp_dt, ......

FROM ody.VHCL_MVS m
INNER JOIN ody.VHCL_PLT_HIST p on p.vhc_vhcl_unit_nbr=m.vhcl_vhcl_unit_nbr

WHERE m.rdy_rnt_agr_nbr = '148685886'

By the way, what does ody mean? Is it schema?

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 5:15pm

What error message did you get. we need error message to trouble shoot.

you need to make sure few things:

1) syntax looks OK.

2) make sure database you connected have these tables and schema: ody.VHCL_MVS,ody.VHCL_PLT_HIST

3) if same columns exists in both tables then you need to specify which table columns did you want. (table alias name.column name)

4) where clause also if exists in both tables you need to mention alias name.

5) where clause data type is important.

August 27th, 2015 6:43pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics