Multiple column queries-syntax, Database Management System

Multiple column Queries:

Syntax:

SELECT COLUMN1, COL2,......

FROM TABLE

WHERE (COLUMN1, COL2, ...) IN

(SELECT COLUMN1, COL2,....

 FROM TABLE

WHERE );

Example: Find the department number, name, job title and salary of those people who have the similar job title and salary as those are in department 10.

SELECT DEPTNO,ENAME, JOB, SAL

FROM EMP

WHERE (JOB, SAL) IN (         SELECT JOB, SAL

                                                 FROM EMP

                                                 WHERE DEPTNO=10);

OUTPUT:

DEPTNO

ENAME

JOB

SAL

10

Nirmal

MANAGER

2975

10

Kailash

ANALYST

3000

20

Ashwin

ANALYST

3000

Posted Date: 3/11/2013 4:01:33 AM | Location : United States







Related Discussions:- Multiple column queries-syntax, Assignment Help, Ask Question on Multiple column queries-syntax, Get Answer, Expert's Help, Multiple column queries-syntax Discussions

Write discussion on Multiple column queries-syntax
Your posts are moderated
Related Questions
Explain Composite attribute in SQL ? Composite attribute: A composite attribute has many components, each of that is atomic or composite.

Ask question #MinimThe Georgia Tech Library (GTL) has approximately 16,000 members, 100,000 titles, and 250,000 volumes (an average of 2.5 copies per book). About 10 percent of the

Describe the shadow paging technique.

properties of derirable decomposition

What is trigger?  Triggers are statements that are executed automatically by the system as the side effect of a modification to the database.

Problem 1. Describe the following a) Advantages of Database Systems b) Functions of a DBMS Explanation of part (a) and (b) 2. Explain the following concepts w

Discuss the mechanism to read data from and write to a disk? Disk read/write heads are mechanisms in which read data from or write data to disk drives. The heads have gone by

Chapter 1 - Profile for the Organization You have to select an organization of your choice and assume that you work for that organization. Now you must prepare a brief profile of t

What is indexed sequential file organization? What are the applications of this organization?  Ans: An index file can be employed to effectively overcome the problem of storing

What are domain constraints? A domain is a set of values that might be assigned to an attribute .all values that appear in a column of a relation must be taken from the similar