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

In this query: SELECT COUNT(*) AS UserCount, Company.* FROM Company LEFT JOIN User ON
I'm trying to run this query: select * from activity where id = 9348927
I need to shorten this query and while I'm pretty good at SQL, I'm
This query works great: var pageObject = (from op in db.ObjectPermissions join pg in
I have this query in sql server 2000: select pwdencrypt('AAAA') which outputs an encrypted
In SQL server 2005 this query select len(cast('the quick brown fox jumped over the
I have this query in LINQ to Entities. var query = (from s in
I think the question itself is pretty self-explanatory. The code is given below -
I have this query var temp = from x in ActiveRecordLinq.AsQueryable<Circuits>() where x.User_Created ==
the code is pretty self explanatory. I'm trying to use sql to retrieve a

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.