Query multiple data from source table

  • Thread starter Thread starter Raven
  • Start date Start date
R

Raven

I have a hugh table of six thousand + rows. I am trying to create a query
that will return employees with multiple rows of data from this table. My
statement is as follows:
SELECT [TableA], Empid, [TableA], Code1, [TableA],CodeA
FROM [TableA]
WHERE ((([TableA].Code1)="Apple" And ([TableA].Code1)="Pear") AND
(([TableA].CodeA)="Red" And ([TableA]CodeA)= "Blue"));

I'm not too proficient with this, so any suggestions is greatly appreciated.


Raven
 
I have a hugh table of six thousand + rows.  I am trying to create a query
that will return employees with multiple rows of data from this table.  My
statement is as follows:
SELECT [TableA], Empid, [TableA], Code1, [TableA],CodeA
FROM [TableA]
WHERE ((([TableA].Code1)="Apple" And ([TableA].Code1)="Pear") AND
(([TableA].CodeA)="Red" And ([TableA]CodeA)= "Blue"));

I'm not too proficient with this, so any suggestions is greatly appreciated.

Raven

Try

SELECT EmpID, Code1, CodeA
from TableA
where EmpID in
( select EmpID
from TableA
group by EmpID
having count(EmpID ) > 1 )
 
Awesome! Thanks.
--

Raven


Lou said:
I have a hugh table of six thousand + rows. I am trying to create a query
that will return employees with multiple rows of data from this table. My
statement is as follows:
SELECT [TableA], Empid, [TableA], Code1, [TableA],CodeA
FROM [TableA]
WHERE ((([TableA].Code1)="Apple" And ([TableA].Code1)="Pear") AND
(([TableA].CodeA)="Red" And ([TableA]CodeA)= "Blue"));

I'm not too proficient with this, so any suggestions is greatly appreciated.

Raven

Try

SELECT EmpID, Code1, CodeA
from TableA
where EmpID in
( select EmpID
from TableA
group by EmpID
having count(EmpID ) > 1 )
 
Back
Top