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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:57:31+00:00 2026-06-13T07:57:31+00:00

I have a permission system between two objects (users => firms) with table permissions

  • 0

I have a permission system between two objects (users => firms) with table permissions for linking. Now i need to update firms table with first permission user id. I made this query:

UPDATE parim_firms, parim_permissions
SET parim_firms.firm_user_id = parim_permissions.permission_a_id
WHERE parim_firms.firm_user_id = 0
    AND parim_firms.firm_id = parim_permissions.permission_b_id

Now if one firm hash multiple linked users, then will it be updated with the first or last matched user?

My logic says after first update firm_user_id != 0 and that row doesn’t get updated anymore.

But im not sure, maybe does it run the query for all joined rows and the last row will stay.

And if it doesn’t then how can i modify the query to update with only first matched result?

  • 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-13T07:57:32+00:00Added an answer on June 13, 2026 at 7:57 am
     UPDATE parim_firms 
     SET parim_firms.firm_user_id = 
      ( 
        select  parim_permissions.permission_a_id from parim_permissions 
        WHERE   parim_firms.firm_id = 0 
        AND parim_firms.firm_id = parim_permissions.permission_b_id 
     )
    

    or

    update parim_firms  a
    set a.firm_user_id  = b.permission_a_id 
    from  parim_permissions  b
    WHERE   parim_firms.firm_id = 0 
        AND parim_firms.firm_id = parim_permissions.permission_b_id 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a process with permissions 4750. Two users exist in my Linux system.
I have a basic permission system where I am pretty much hardcoding permissions based
I have an ASP.NET MVC website where I've established a system of Permissions. There
Ok, I have a role based permission system in place and would like admin's
i have a private section where specific users can login on my system (restricted
I'm trying to implement a table row permission system in my database (with a
I need to add user roles and permission system into my web application built
I have a delete issue at the moment. We do not have permission to
I'm on a shared webhost where I don't have permission to edit the global
I want to parse a couple of thousands XML-files from a website(I have permission)

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.