1

In the below attempt I am trying to concatenate two columns from the same table and it says "invalid number of arguments" when I try to run it.

 SELECT  Concat(b.OB,',',C.OB) AS LANE 
  ,(
    CASE
            WHEN a.vehicle_class LIKE '601%'
            THEN 'Small'
            WHEN a.vehicle_class LIKE '602%'
            THEN 'Large'
            WHEN a.vehicle_class LIKE '9%'
            THEN 'TOW'
            ELSE 'ERROR'
    END) AS vehicle_size
    , a.*
FROM
    (SELECT *
    FROM    reserved

    ) a
  , location b
  , location c
  , mre_system_parameters SYS
WHERE   b.ob_location_id = a.ob_location_id
AND c.ob_location_id = a.ib_location_id
AND rental_date      > sys.cpd - 20000
AND rental_date     <= sys.cpd
AND a.vehicle_class  LIKE '6%'
AND booking_count    = 1;

COMMIT;

2 Answers 2

2

Oracle's concat takes strictly two arguments, not three as you have in your query. You could just use a series of concatenation operators (||) instead:

b.OB || ',' || C.OB AS LANE 
Sign up to request clarification or add additional context in comments.

Comments

1

In oracle it is more convenient to use || operator for concatenation. thus,

b.OB || ',' || C.O 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.