berkshirea
Technical User
hi guys, can you please help me out with this sql stement i am trying to figure out. i've been trying but i think my sql skill is still not good.
i have a sample table here:
wordtexts ip
-------- ----------
tokyo 1.1.1.1
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
moscow 1.1.1.1
new york 7.7.7.7
tokyo 4.4.4.4
vancouver 5.5.5.5
athens 6.6.6.6
mumbai 1.1.1.1
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2
tokyo 8.8.8.8
manila 1.1.1.1
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2
vancouver 7.7.7.7
new york 2.2.2.2
and have these steps.
1. exclude rows with ip = 1.1.1.1
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
new york 7.7.7.7
tokyo 4.4.4.4
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2
tokyo 8.8.8.8
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2
vancouver 7.7.7.7
new york 2.2.2.2
2. note ip's that has tokyo
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
new york 7.7.7.7
tokyo 4.4.4.4--------
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2---------
tokyo 8.8.8.8---------
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2---------
vancouver 7.7.7.7
new york 2.2.2.2
3. note also other rows of wordtexts that has those ip's
wordtexts ip
-------- ----------
singapore 2.2.2.2--
london 8.8.8.8--
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2--
new york 7.7.7.7
tokyo 4.4.4.4--------
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2--
java 5.5.5.5
tokyo 2.2.2.2---------
tokyo 8.8.8.8---------
vancouver 4.4.4.4--
athens 2.2.2.2--
mumbai 5.5.5.5
tokyo 2.2.2.2---------
vancouver 7.7.7.7
new york 2.2.2.2--
4. exclude all rows that has tokyo
wordtexts ip
-------- ----------
singapore 2.2.2.2--
london 8.8.8.8--
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2--
new york 7.7.7.7
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2--
java 5.5.5.5
vancouver 4.4.4.4--
athens 2.2.2.2--
mumbai 5.5.5.5
vancouver 7.7.7.7
new york 2.2.2.2--
5. exclude all rows that has no same marked ip's from #3
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
munich 2.2.2.2
hokaido 2.2.2.2
vancouver 4.4.4.4
athens 2.2.2.2
new york 2.2.2.2
step #5 is the final recordset that i want to see as a result.
i hope i have illustrated enough my problem. thanks for any advice/help.
.
i have a sample table here:
wordtexts ip
-------- ----------
tokyo 1.1.1.1
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
moscow 1.1.1.1
new york 7.7.7.7
tokyo 4.4.4.4
vancouver 5.5.5.5
athens 6.6.6.6
mumbai 1.1.1.1
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2
tokyo 8.8.8.8
manila 1.1.1.1
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2
vancouver 7.7.7.7
new york 2.2.2.2
and have these steps.
1. exclude rows with ip = 1.1.1.1
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
new york 7.7.7.7
tokyo 4.4.4.4
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2
tokyo 8.8.8.8
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2
vancouver 7.7.7.7
new york 2.2.2.2
2. note ip's that has tokyo
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2
new york 7.7.7.7
tokyo 4.4.4.4--------
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2
java 5.5.5.5
tokyo 2.2.2.2---------
tokyo 8.8.8.8---------
vancouver 4.4.4.4
athens 2.2.2.2
mumbai 5.5.5.5
tokyo 2.2.2.2---------
vancouver 7.7.7.7
new york 2.2.2.2
3. note also other rows of wordtexts that has those ip's
wordtexts ip
-------- ----------
singapore 2.2.2.2--
london 8.8.8.8--
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2--
new york 7.7.7.7
tokyo 4.4.4.4--------
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2--
java 5.5.5.5
tokyo 2.2.2.2---------
tokyo 8.8.8.8---------
vancouver 4.4.4.4--
athens 2.2.2.2--
mumbai 5.5.5.5
tokyo 2.2.2.2---------
vancouver 7.7.7.7
new york 2.2.2.2--
4. exclude all rows that has tokyo
wordtexts ip
-------- ----------
singapore 2.2.2.2--
london 8.8.8.8--
manila 3.3.3.3
paris 5.5.5.5
munich 2.2.2.2--
new york 7.7.7.7
vancouver 5.5.5.5
athens 6.6.6.6
hokaido 2.2.2.2--
java 5.5.5.5
vancouver 4.4.4.4--
athens 2.2.2.2--
mumbai 5.5.5.5
vancouver 7.7.7.7
new york 2.2.2.2--
5. exclude all rows that has no same marked ip's from #3
wordtexts ip
-------- ----------
singapore 2.2.2.2
london 8.8.8.8
munich 2.2.2.2
hokaido 2.2.2.2
vancouver 4.4.4.4
athens 2.2.2.2
new york 2.2.2.2
step #5 is the final recordset that i want to see as a result.
i hope i have illustrated enough my problem. thanks for any advice/help.
.