What will be the output for the below Query
Select 'High' from dual where null = null;
Answers were Sorted based on User's Feedback
Answer / shijo
The Answer will always be null, since you never can equate a
NULL to another NULL. if the query was "Select 'High' from
dual where null IS null;" The answer would have been "High"
Is This Answer Correct ? | 61 Yes | 19 No |
Answer / abhishek6555
The answer will be no rows selected as null = null will be
false condition and the where condition will become false.
Is This Answer Correct ? | 14 Yes | 7 No |
Answer / amedela chandra sekhar
The correct answer is
SQL> Select 'High' from dual where null = null;
no rows selected
Chandu
chandumba2005@gmai.com
Is This Answer Correct ? | 9 Yes | 5 No |
Answer / kart
since the query is syntaxically correct
the output will be
no rows selected;
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / vijay repe
Query will give o/p as 'High' if condition u put as null is
null insteat of null = null.
It considers as false where condition same as 1=2;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sri
two nulls are not equal
so the answer is no rows selected.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / zia
Syntax is correct, but result will show only column heading without data as 'HIGH'.
Is This Answer Correct ? | 2 Yes | 3 No |
how to saw triggers output in pl/sql database?
What are the advantages of stored procedure?
Can we perform dml on view?
how to fetch alternate records from a table? : Sql dba
how to check the 3rd max salary from an employee table? One of the queries used is as follows: select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal). Here in the sub query "select count(distinct(sal)) from emp b where a.sal<=b.sal" or "select count(distinct(sal)) from emp b where a.sal=b.sal" should reveal the same number of rows is in't it? Can any one here please explain me how is this query working perfectly. However, there is another query to get the 3rd highest of salaries of employees that logic I can understand. Pls find the query below. "select min(salary) from emp where salary in(select distinct top 3 salary from emp order by salary desc)" Please explain me how "select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal)" works source:http://www.allinterview.com/showanswers/33264.html. Thanks in advance Regards, Karthik.
List the ways to get the count of records in a table?
Define sql delete statement.
Mention what plvcmt and plvrb does in pl/sql?
What is the usage of sql functions?
Hi Guys, I have a situation where I need to access the column values from rowtype variable. However, the column names are dynamic. below is sample code: declare Cursor c1 is select * from emp; Cursor c2 is select column_name from xyztable; v_c2 c2%rowtype; v_str varchar2 v_value varchar2(200); begin for rec in c1 loop open c2;---this cursor has column names like EMPLOYEE_ID, FIRST_NAME, LAST_NAME etc. loop fetch c2 into v_c2; exit when c2%notfound; /* now lets say i want to access value of LAST_NAME from cursor c1, so I am writing below code, however it does not work as expected */ v_str:= 'rec.'|| v_c2.column_name; -- this will give me string like "rec.EMPLOYEE_ID" v_value:=v_str; end loop; end loop; end; / Plz help ASAP.Thanks.
Give which cursor is better for better performance means type of cursors?
what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba