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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:35:29+00:00 2026-06-01T10:35:29+00:00

I have a problem. I have 3 tables like below: 1) met_ID (primair) etc.

  • 0

I have a problem. I have 3 tables like below:

1) met_ID (primair) etc.

2) magn_ID (primair)
met_ID (secondary)
…

3) sens_ID (primair)
met_ID (secondary)
…

I have to delete records in table 1 where met_ID count in table 2 OR 3 is less than 10..

SELECT COUNT(*) AS count, met_ID
FROM tbl_1, tbl_2
Where met_ID = met_ID
GROUP BY met_ID

I made a query and in PHP with WHILE loop i am deleting that records from table 1. It works fine for 1000 records to delete, but I am not sure if it will be use full for 100 000 or more records in table.

Is there any way to accomplish what i do in sql query?

  • 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-06-01T10:35:31+00:00Added an answer on June 1, 2026 at 10:35 am
    DELETE from tbl_1
    WHERE 10 > (select count(*) from tbl_2 where tbl2.met_id=tbl1.met_id) OR
          10 > (select count(*) from tbl_3 where tbl3.met_id=tbl1.met_id)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table structure like below: events (boxing, sparring etc) competitors (users who are
that my problem: I have database table like that: id (AI) market_id 1 6
I have a problem where I have code like <table id=table> <tr> <td>...</td> <tr>
I have a mysql problem. I have two tables like this that I need
I have these two tables setup and the below query running. The problem is
i have problem with linq2sql. As you see below I have two tables from
I have a table within another table, that look like below. What I want
I have a problem with tables joining. I have two tables: product_commons and product_prices.
Hi I have a problem saving 2 tables of my database at the same
I have a problem with mutual constraints. I want to have two tables each

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.