My problem is this
1 - I start with the internal id of 1
2 - I need ot find the only container in table 1 with 1 record
Expected output = 102
My attempts have been
select
id, container
from
table 1
where
substr(container,1,9) in
(
select substr(container,1,9)
from table 1
where ID in (1)
) and
having count(container) = 1
group by id, container -- I really don't want to group here, but have to and this screws up the query
order by container
Thanks in advance
02-21-2013, 01:38 AM
Paresh Jagnade
I have some question based on this :
1)Do you want only records from Table1, which have no repetitive container like 'A01002'
2)The select query doesn't contain Table2, so what exact query should be only table1
If you want non repetitive container from table1 then use below query
select count(Container ), Container from table 1
group by Container
having count(Container ) = 1
Do reply on the above 2 points and whether this will suffix your problem.