Skip to content
Advertisement

How to cross join two tables in sql

So I need to cross join 2 tables but I cannot find a way to do so without receiving the error

ORA-01427: single-row subquery returns more than one row ORA-06512: at “SYS.DBMS_SQL”, line 1721

Here is my code I am using but I am unaware where my error is coming from, I am new to sql so any help is appreciated:

Advertisement

Answer

(Select Expire_Date From SAP_Data Where Personnel_Number = _ESA.Personnel_Number AND Duplicate1 = ‘Valid’ AND Course_Num = Safety_Map.Course_Num)

Is returning more than one rows. If you just need top one then you can use rownum or fetch first 10 rows only

or you can use aggregation (max() or min()):

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement