Query multiple data from source table

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
 
L

Lou

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 )
 
R

Raven

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 )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top