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

  • Home
  • SEARCH
  • 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 7019005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:07:34+00:00 2026-05-27T23:07:34+00:00

I have a DB with postgresql and I wrote two simple queries select page

  • 0

I have a DB with postgresql and I wrote two simple queries

select page from title where word = 'france' and part = 'headline';

and

select page from title where word = 'france' 
intersect 
select page from title where part = 'headline';

I think they should return the same result but actually it’s different. Any suggestions?

The table structure is simply id, word, page, part.

EDIT:

I tried also

select distinct

but the query with intersect always returns some non relevant results.
This is a DB of a simple reverse table of some web news pages. So page, word and part are not unique. But no duplicated entries.

  • 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-27T23:07:35+00:00Added an answer on May 27, 2026 at 11:07 pm

    WHERE (a) AND (b) is a boolean condition applied to Every record. A record only gets included if it satisfies the whole condition. In other words, only records where word is ‘france’ AND part is ‘headline’ at the same time will be included.

    Is what you need more similar to using an OR in your condition?

    select page from title where word = 'france' or part = 'headline';
    

    Or are you having problems due to there being multiple records referencing the same page?

    For example…

    1 | 'france'  | 'aaa' | 'headline'
    2 | 'france'  | 'bbb' | 'body'
    3 | 'germany' | 'bbb' | 'headline'
    

    'aaa' will be returned by both your queries.

    'bbb' will be returned by only your second query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

all! I have Postgresql and query SELECT complex_expression() FROM t WHERE complex_expression() != '';
I have postgresql (in perlu) function getTravelTime(integer, timestamp), which tries to select data for
I'm trying to write two types of stored procedures in PostgreSQL. From what I
I have wrote a few simple Rails application, accessing the database via the ActiveRecord
I have a Postgresql database on which I want to do a few cascading
Background: I have a PostgreSQL (v8.3) database that is heavily optimized for OLTP. I
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but
I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
In PostgreSQL 8.3 database I have bookings table referencing booking_transactions table by ID. So
I have a table in PostgreSQL where the schema looks like this: CREATE TABLE

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.