I'm coming to you because I currently have a problem with a SQL query.
Let me explain :
I have two tables, the first say tableA, record all the different terminals that connected to my application:
The COIDTE field corresponds to the identifier of the terminal (unique).
Then I have a second table say tableB which records all connections to the application and stores the identifier of the connected terminal (COIDTE) and the jailbreak status of the terminal (if 0 non-jailbreak terminal).
I am asked to return the number of trusted terminal, knowing that a terminal is said to trust if there has been at least 5 connections or jailbreak status is 0.
I can not do that with one request ... I tried several things but I can not combine everything .. thx for help :)
i tried :
Select count(a.COIDTE),
From TableA a, TableB b
Where a.COIDTE= b.COIDTE
HAVING ( Select count( distinct COIDTE ) from tableA where CTJDTE ='0'


left jointhe two tables andselectthecounts,group byand usehaving