How Do i write a SQL query for this - Plz HELP URGENT

How Do i write a SQL query for this - Plz HELP URGENT

Post by viva » Sat, 18 Dec 1999 04:00:00



I have the following tables,
Employee( filelds are EmpID,Name)
Example EmpID Name
                1        John
                2        Murray
                3        Luther
                4        Sharon
Supervisors(fields are EmpID,SupervisorEmpID)
  Example    EmpId    SupervisorID
                    1            2
                    2            3
                    3            4
I want to retrieve the names of Employees and their supervisors
the result should be something like,
Emp Name Supervisor Name
John           Murray
Murray        Luther
Luther        Sharon

Thanks in advance

 
 
 

How Do i write a SQL query for this - Plz HELP URGENT

Post by Andrea Ballar » Sat, 18 Dec 1999 04:00:00


select e.Name, s.Name
from Employee e, Supervisor s
where s.SupervisorID = e.EmployeeID

>I have the following tables,
>Employee( filelds are EmpID,Name)
>Example EmpID Name
>                1        John
>                2        Murray
>                3        Luther
>                4        Sharon
>Supervisors(fields are EmpID,SupervisorEmpID)
>  Example    EmpId    SupervisorID
>                    1            2
>                    2            3
>                    3            4
>I want to retrieve the names of Employees and their supervisors
>the result should be something like,
>Emp Name Supervisor Name
>John           Murray
>Murray        Luther
>Luther        Sharon

>Thanks in advance


 
 
 

How Do i write a SQL query for this - Plz HELP URGENT

Post by Andrea Ballar » Sat, 18 Dec 1999 04:00:00


I accidently left out a join that was needed:

select e.Name, s.Name
from Employee e, Employee s, Supervisors su
where su.empid = e.empid
and su.supervisorid = s.empid

Sorry about that....  (blame it on the flu)

Andrea Ballard
Database Analyst
IPS-Sendero


>select e.Name, s.Name
>from Employee e, Supervisor s
>where s.SupervisorID = e.EmployeeID


>>I have the following tables,
>>Employee( filelds are EmpID,Name)
>>Example EmpID Name
>>                1        John
>>                2        Murray
>>                3        Luther
>>                4        Sharon
>>Supervisors(fields are EmpID,SupervisorEmpID)
>>  Example    EmpId    SupervisorID
>>                    1            2
>>                    2            3
>>                    3            4
>>I want to retrieve the names of Employees and their supervisors
>>the result should be something like,
>>Emp Name Supervisor Name
>>John           Murray
>>Murray        Luther
>>Luther        Sharon

>>Thanks in advance

 
 
 

How Do i write a SQL query for this - Plz HELP URGENT

Post by Ramda » Tue, 21 Dec 1999 04:00:00


select a.name,b.name
from employees a,employees b,supervisors c
where b.empid=c.SupervisorEmpID and
      c.empid=a.empid

>I have the following tables,
>Employee( filelds are EmpID,Name)
>Example EmpID Name
>                1        John
>                2        Murray
>                3        Luther
>                4        Sharon
>Supervisors(fields are EmpID,SupervisorEmpID)
>  Example    EmpId    SupervisorID
>                    1            2
>                    2            3
>                    3            4
>I want to retrieve the names of Employees and their supervisors
>the result should be something like,
>Emp Name Supervisor Name
>John           Murray
>Murray        Luther
>Luther        Sharon

>Thanks in advance

 
 
 

1. Help plz,plz,plz!!!

I got a data component:

name         : datGebruikers
Connect    : Access 2000
Defaulttyp :    1- UseJet
Reasonly   : False
RecordType: Dynaset
RecordSource: Login

A dbCombobox:

name :dbcboGebruikers
rowsource: datGebruikers
Listfield: User
Boundcolumn: UserId
DataField : UserId

And some textboxes and checkboxes linked to different fields in
datGebruikers.

I want the checkboxes and textboxes to be updated according to the selection
I make in the dbcombobox.

Dim zoeken As String

zoeken = dbcboGebruikers.BoundText

datGebruikers.Recordset.Index = "PrimaryKey"
datGebruikers.Recordset.Seek "=", Val(zoeken)

If Val(zoeken) = 1 Then
    Call deselecteren
Else
    Call Selecteren
End If

But this does not work. It tells me that "Operation is not supported for
this type of object" and refers to the index = "PrimairyKey"

So i delete this part and run again and and still the same message but now
it's referring to the seek operation.

Can NE1 help me with what I'm doing wrong?

2. Error: ORA-01002

3. PLZ, PLZ, Help with Importing Errors w/SQL 2K

4. Help Me!! Problem of contorl source of databound ActiveX control in Access97

5. URGENT: Please help write this query

6. Internal error [The parameter is not valid] ''

7. Please help write a query **Urgent** tks

8. FYI: UK SQL Server professionals - Full day seminar Reading

9. Plz help with this Query (SQL 6.5) !!!!!!!!!!!!!!

10. plz help me...urgent

11. LIKE operator and variables (Urgent Plz Help)

12. URGENT HELP PLZ !!!!!

13. URGENT Readin Cellset via ADOMD Plz help!