HELP - selecting

A

ainese

I have a table with ESN and SERVICE TYPE and SUBSCRIBER TYPE. ESN can
appear more than once depending on the number of services associated.
Each service type has a charge.

To date I have the below code - where i'm trying to count esn where
service type is only = basic and not equal to data push or
tracking....

SELECT Count(F.ESN) AS ["Basic Activations"]
FROM Data AS F
INNER JOIN Data AS G ON (F.ESN= G.ESN AND F.SERVICE= "Basic" AND
G.SERVICE <>"Data Push" AND G.SUBSCR_TYPE = "Service Activation")
WHERE G.ESN NOT IN
(SELECT ESN FROM Data WHERE SERVICE = 'Tracking');

I am trying to select 'service' where service is only equal to 'Basic'
and not equal to 'Data Push' or 'Tracking'.

I added G.SERVICE <> "Data Push" but with the inner join I'm getting
some duplicates of 'Data Push' due to the
INNER JOIN

How do I omit them,

Can anyone advise me on how to do this please?

Thanks
 

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

Similar Threads

Not Equal To 1
Help Please 5
Query code for 'only equal to' 0
Select 'ONLY = TO' 1
'Not Equal to' 1
Is it possible to select only equal to 0
HELP PLEASE 3
beginner sql query 0

Top