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 6901323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:39:33+00:00 2026-05-27T07:39:33+00:00

Assuming this is my table: email | col1 | col2 ——+——-+—— a@a | 1

  • 0

Assuming this is my table:

email |  col1 |  col2
------+-------+------
a@a   |   1   |   0
a@a   |   0   |   1
b@b   |   0   |   1
c@c   |   1   |   0

I’m trying to update each row where email has more than one of the same entry. In the table above a@a is listed twice with a 1 in col1 and in the next record a 1 in col2. I’d like a single record for a@a with a 1 in both col1 and col2. and then I can remove duplications afterwards.

I should then be left with a table where only in record exists for each email and I can then filter on having 1 in col1, col2 or both.

I’ve tried sorting this data using group by email having col1 = 1 and col2 = 1, but that won’t work (presumably it only filters on the first record found, not a combined subset of the data – makes sense).

I’m sure this is an easy one and I’m just having another one of those days, any help appreciated.

  • 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-27T07:39:33+00:00Added an answer on May 27, 2026 at 7:39 am

    would this help:

    select email, max(col1) as col1, max(col2) as col2 from table group by email
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
Assuming that I cannot run something like this with Fabric: run(svn update --password 'password'
Assuming I have a table with one field called ID that stores 100 different
Difficult to put down in words, so assuming this example table: | id |
Assuming this table with nearly 5 000 000 rows CREATE TABLE `author2book` ( `author_id`
Possible Duplicate: Importance of varchar length in MySQL table When using VARCHAR (assuming this
I have got a table, and it has a label in one of its
Consider this simple model, where a Project has one ProjectType and, naturally many Projects
Assuming this table is ordered by date id | date | customer 3 |
Assuming this is a multi-user system

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.