All pastes #931360 Raw Edit

Unnamed

public sql v1 · immutable
·published 2008-03-07 03:08 UTC
rendered paste body
select * from (select abssolutionid,count(abssolutionid) as numcomponentsinsoln  from abstractcomponent ac1 inner join abssolutionabscomponent asac on ac1.id = asac.abscompidwhere	(		ac1.inchistring = 'H2O' or		((ac1.inchistring is null or ac1.inchistring = '') and ac1.name = 'Water')	) 	or	(		ac1.inchistring = 'KCl' or		((ac1.inchistring is null or ac1.inchistring = '') and ac1.name = 'Potassium Chloride')	)group by abssolutionid) as solutionswithany where numcomponentsinsoln = 2;