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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:02:50+00:00 2026-06-09T13:02:50+00:00

tbl_cmp usr_id | cmp_name | usr_fname |cmp_addr tbl_usr cmp_usr_id |cmp_id | cmp_usr_fname | cnt_status

  • 0

tbl_cmp

usr_id | cmp_name | usr_fname |cmp_addr

tbl_usr

cmp_usr_id |cmp_id | cmp_usr_fname | cnt_status 

I am trying query retrieve data from both at a time for ::
retrieve all data from tbl_cmp
but
retrieve only field from tbl_usr that cnt_status=1

I tried this

SELECT *
FROM tbl_cmp
JOIN tbl_usr ON tbl_usr.cmp_id = tbl_cmp.usr_id
WHERE tbl_usr.cnt_status =1

but it shows only record that has cnt_status=1 not all record from first table

  • 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-09T13:02:52+00:00Added an answer on June 9, 2026 at 1:02 pm

    Try this

    SELECT * FROM tbl_users LEFT JOIN tbl_cmp_user 
    ON tbl_cmp_user.cmp_id = tbl_users.usr_id 
    AND tbl_cmp_user.cnt_status =1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run this query: SELECT * FROM tbl_person WHERE to_date(date_create, 'dd/mm/yyyy') < to_date('01/01/2010',
Suppose I had a query select name from tbl where dept = 123 which
Have follow query: SELECT tbl_yaca_sites.`id_site` FROM `tbl_yaca_sites` INNER JOIN `tbl_relation` ON tbl_relation.id_website = tbl_yaca_sites.id_site
I'm trying: select tbl.*, (true and true) as booleanTest from tbl which ms-sql doesn't
tbl_customer.id is the customer's id tbl_order.customer_id a query that will select all customers with
SELECT * FROM tbl_transaction t LEFT JOIN tbl_transaction_hsbc ht ON t.transactionid = ht.transactionid transactionid
SELECT * FROM tbl_group_join tgj LEFT JOIN tbl_groups tg ON tg.group_id = tgj.group_id LEFT
SELECT * FROM tbl_houses WHERE (SELECT HousesList FROM tbl_lists WHERE tbl_lists.ID = '123') LIKE
SELECT * FROM tbl_order_head AS o INNER JOIN tbl_orders_log AS c ON o.PAYMENT_TRANSACTION_LOG_ID=c.TRANSACTION_ID WHERE
SELECT * FROM tbl WHERE version = (SELECT MAX(version) FROM tbl WHERE t2.entityId =

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.