My query gets data from two tables and join them to give output as a single output. Subquery works without any error. But when i run the whole query i get an error like this.
Arithmetic overflow error converting varchar to data type numeric.
This is my query
SELECT a.REF_NO + ' - '
+ (SELECT DISTINCT ( c.c_name )
FROM C_MASTER c,
A_MASTER a
WHERE a.c_no = c._NO) AS refer
FROM [A_MASTER] a,
[C_MASTER] c
WHERE a.c_no = c._no
ORDER BY a.REF_NO
REF_NO is numeric data type.