sql - TSQL - Query for multiple types in multiple rows -


I have a table where each address has every type of line, how to find the address, where I type the exact type the wanted?

Example.

  ID TypID Street 1 1 Street 1 1 2 Street 1 2 Street 2 3 1 Street 3 3 Street Street 3  

In the above, find me such addresses Who have type 1 and 2 This query should be with results 1 and 3 id. Group

by ID and then separate typeid Selecting code from typed in (1,2) group section

in the >
  select the ID from your_ table 

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -