Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6249967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:20:08+00:00 2026-05-24T13:20:08+00:00

SELECT E1.Department, E1.DeptPhone FROM EMPLOYEE AS E1 WHERE EXISTS (SELECT E2.Department FROM EMPLOYEE AS

  • 0
SELECT E1.Department, E1.DeptPhone
FROM EMPLOYEE AS E1
WHERE EXISTS
    (SELECT E2.Department
    FROM EMPLOYEE AS E2
    WHERE E1.Department = E2.Department
        AND E1.DeptPhone <> E2.DeptPhone);

So, when I read this query I think that I’m selecting the dertments, from table E2, that are equal to the departments from E1, that also have different phone numbers.

Since EXISTS is a correlated subquery, I’m also selecting the departments (from E1) and the DeptPhone (also from E1), but I’m only selecting the departments work with my subquery.

In other words, I’m displaying the departments (that doen’t have the same phone numbers as E1 but do have the same department name as E1), and the DeptPhone from E1. Am I reading that right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:20:09+00:00Added an answer on May 24, 2026 at 1:20 pm

    You are displaying all departments where there is another record with the same department name, but a different phone number. I.e., you are displaying all departments with more than one phone number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my query, CREATE VIEW employee_vu AS( SELECT employee_id,last_name employee,department_id FROM employees); I
select * from ContactInformation c where exists (select * from Department d where d.Id
select max(DELIVERY_TIMESTAMP) from DOCUMENTS; will return the time that the latest document was delivered.
I have created this query to fetch some result from database. Here is my
SELECT department_name AS dept_name, last_name, project_number FROM departments dpt JOIN employee emp ON dpt.department_number
I have a query SELECT id, descr Category, parent_id `Department`, updated `Updated` , updatedby
I have a simple form where users can select a department from a choicefield.
I have a query: select event_type, department_name, effective_time, row_number() OVER (PARTITION BY event_type,department_name ORDER
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part:
select distinct constraint_type from user_constraints; C - C P R U Seems P means

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.