What is a self join? Explain it with an example?
Answer Posted / vijayan.t
A table join to itself is known as self join.
select e1.empid,e1.empname,e1.empmgrname where empmgrid =
empid;
here in a single table e1 having three fields(employee id,
employee name,manager id)one employee's manager id is
another one employee's employee id so compare that 2 ids and
we can get the particular employee's manager name...
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?
What is an application role and explain a scenario when you would use one?
You have a table with three columns: amount1, amount2, and amount3 in a single row only one of these three columns will have a value and the other two will be null. Write a sql query to retrieve the values from these columns?
What is dbms explain in brief?
How to use timestamp datatypes
Explain about xml databases?
Write the fastest query to find out how many rows exist in a table?
When installing the datastage7.5x2 edtion iam getting aproblem i.e the cpu count is 2 but the cpu count in installation is one . how can i install in my p.c (system is dual core).
Explain about the database management systems.
How to use online Backups?
If a column is an image value type, how you can compare column values? How can you use this column in join clause?
Why does this query return 0?
Who are end users in dbms?
In which database can extended stored procedures be added?
How long can an error message be in raiseerror function?