Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
-
Dear all, Pls help me solve this.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code,vessel_desc from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
when i execute this query error occour as below
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks and best regards -
Dear all, Pls help me solve this.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code,vessel_desc from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
when i execute this query error occour as below
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks and best regardsThe sub query returns 2 columns but in where clause only one column. The query should be like
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
thatraja
-
Dear all, Pls help me solve this.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code,vessel_desc from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
when i execute this query error occour as below
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks and best regardsI had to read that twice before it sank in what you are doing. Besides trying to compare 1 field to 2 fields in the subselect (which is only allowed to return 1 field) have you looked at the where clause.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code <> ''
This should achieve the same thing without the sub select.
Never underestimate the power of human stupidity RAH
-
Dear all, Pls help me solve this.
select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code,vessel_desc from D4A_RAW_BLP where vessel_code<>'') order by vessel_code
when i execute this query error occour as below
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks and best regardstry this query.......... select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code is not null) order by vessel_code
Regards: Ganu Sharma ;)