Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3434764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:44:18+00:00 2026-05-18T07:44:18+00:00

This query is pretty self explanatory: $networks = ‘6,7,8’; $query = SELECT DISTINCT countryName

  • 0

This query is pretty self explanatory:

$networks = '6,7,8';

$query = "SELECT DISTINCT countryName 
FROM countries AS Country
INNER JOIN countries_networks AS n ON Country.id = n.country_id
WHERE n.network_id IN (".$networks.")";

However, if I want to select the network number 8, but NOT 6,7, how would I do that?

kind of a IN('8') but NOT IN('6,7')

The use of IN() is a not requirement.

I am after the countries that ONLY have a network of 8. The reason being is that I have 2 levels of cell-phone. Say, the ‘scumbag-phone’ that works in networks 6 & 7, and the ‘Uber-phone’ that works in networks 6,7 & 8.
I want to get the countries where it is essential that you have an Uber-phone (8 only). At the moment these queries will get 8, but not exclusively. They pay no heed to the fact that there may also be 6,7 in there, deeming the Uber-phone non-essential.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:44:18+00:00Added an answer on May 18, 2026 at 7:44 am
    $query = "SELECT DISTINCT countryName 
    FROM countries AS Country
    INNER JOIN countries_networks AS n ON Country.id = n.country_id
    WHERE n.network_id in (8) AND not n.network_id  in (6, 7)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Mysql 5.0.77 and I'm pretty sure this query should work? SELECT *
This query works: item = db.GqlQuery(SELECT * FROM Item WHERE CSIN = 13)[0] although
I'm trying to run this query: select * from activity where id = 9348927
I have a feeling that this query is pretty easy to construct, I just
I kind of stuck on how to implement this query - this is pretty
Currently, I am using this query, which does a pretty good job of finding
I'm pretty sure I did this right, but my query has been running for
This query works great: var pageObject = (from op in db.ObjectPermissions join pg in
This query selects all the unique visitor sessions in a certain date range: select
I think the question itself is pretty self-explanatory. The code is given below -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.