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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:04:01+00:00 2026-06-15T15:04:01+00:00

i am stuck with sql query. i want to select product from single table

  • 0

i am stuck with sql query.
i want to select product from single table but exlude selected product.
i have wp_product table as

product_id   prod_name   prod_price   prod_rate
   1           xyz         100           5
   2           pqr         200           6 
   3           lmn         300           6

I am trying to execute this query

select * 
from wp_products 
where product_id <>'1' AND prod_price <=200 OR prod_rate='6'  OR 
          order by product_id DESC 
          LIMIT 4"

using this select * from wp_products where product_id <>'1'; I get result

product_id    prod_name    prod_price  prod_rate
   2            pqr         200          6 
   3            lmn         300          6

and from this above result i want select(check) for all “OR” condition that i used in my tried query.

suggest me how can i get this.

  • 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-15T15:04:01+00:00Added an answer on June 15, 2026 at 3:04 pm

    If I’m understanding you correctly – just use parenthesis:

    select * 
    from wp_products 
    where product_id <>'1' AND 
      (price<=200 OR wheel_size='6'  OR  studs='$studs') 
    order by product_id DESC 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query SELECT P.PRICE, P.PRODUCT_ID FROM PRODUCT P WHERE P.PRODUCT_ID IN
need help/guide for sql select query, I have 2 table stock and stock_history, in
I want to have three tables in my sql query but I get an
hi guys i am stuck converting below sql to LINQ query. all i want
I'm stuck with a SQL query. Let's say we have an employee, a task
I have to find friends of friends (not my friends) from an sql table
I have a query which is something like this SELECT t.category, tc.product, tc.sub-product, count(*)
I'm a little stuck with an sql query. I've searched everywhere but to no
I'm stuck on a SQL query. Consider the following table: Table DG_GAME_ROUNDS RoundId int
Bit stuck here. Say I run the following SQL query: select to_char(sysdate, 'DD/MON/YY') ||

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.