Я не вижу, где вы объявляете context
. С целью создания намерения вы можете использовать MainActivity.this
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Intent intent = new Intent(MainActivity.this, SendMessage.class);
String message = "abc";
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
});
. Чтобы получить объект после нажатия, вы можете использовать AdapterView
:
ListEntry entry = (ListEntry) parent.getItemAtPosition(position);
Вы можете сделать:
select t.*
from table t
where t.c = 0 and
not exists (select 1 from #tm t1 where t1.a = t.a and t1.c < 0)
Вы можете использовать group by
и having
:
select a
from t
group by a
having min(c) = 0 and max(c) = 0;
С NOT EXISTS
:
select distinct a from tablename t
where not exists (
select 1 from tablename
where
a = t.a
and
c <> 0
)
Попробуйте это:
Select
A
from #tmp
group by A
Having
count(*)=count(case when c=0 then 0 else null end)
Попробуйте это:
select distinct A from [dbo].[table] where A not in (
select A from [dbo].[table] where C <> 0)
Вы можете проверить среднее значение C, если оно равно 0, тогда все значения C равны нулю для B,
SELECT A
FROM table
GROUP BY A
HAVING SUM(ABS(C))=0
Для SQL Server:
SELECT A FROM ta
EXCEPT
SELECT A FROM ta WHERE C <> 0