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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:21:01+00:00 2026-06-14T09:21:01+00:00

i have three tables like follows: this one table : m_application_resources resourceid resource_name menu_group_id

  • 0

i have three tables like follows:

this one table : m_application_resources

 resourceid resource_name   menu_group_id   menu_name   creation_date   last_created_by updation_date   last_updated_by

and the second table : m_roles

roleid  rolename    description creation_date   last_created_by updation_date   last_updated_by

and the third table is : m_access_matrix

accessid    resourceid  roleid  creation_date   last_created_by updation_date   last_updated_by

Relationship for the table is : resourceid and roleid

and this my query

select  am.accessid, ar.resource_name,rls.rolename
from m_application_resources ar, m_roles rls,m_access_matrix am 
where ar.resourceid=am.resourceid 

this returns the following :

ccessid resource_name   rolename
1   DepartmentAction    Admin
1   DepartmentAction    Client
1   DepartmentAction    Doctors
2   PositionsAction     Admin
2   PositionsAction     Client
2   PositionsAction     Doctor

the result is wrong and i don’t know how to go about.

Ex : DepartmentAction should come only once and the role name should be any one.

SqlfiddleFiddle

Please help

  • 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-14T09:21:03+00:00Added an answer on June 14, 2026 at 9:21 am

    You do not have a condition on role_id:

    select  am.accessid, ar.resource_name,rls.rolename
    from m_application_resources ar, m_roles rls,m_access_matrix am 
    where ar.resourceid=am.resourceid AND am.roleid = rls.roleid
    

    I would convert the query to ANSI SQL syntax for joins for better clarity:

    SELECT am.accessid, ar.resource_name,rls.rolename
    FROM m_application_resources ar
    JOIN m_access_matrix am ON ar.resourceid=am.resourceid
    JOIN m_roles rls ON am.roleid = rls.roleid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables like this: Person table: person_id | name | dob --------------------------------
If I have three different tables like this table_1 Field 1: victories Field 2:
I have three tables: videos, videos_categories, and categories. The tables look like this: videos:
I have three tables. The designs were like student table create table student (studID
I have a table like this, with three fields: User | Question# | Answer
I have three tables CLASSES , CHILD_CLASSES , and STUDENTS . CLASSES looks like
I have a table like this: <table id='inventory_table'> <tr id='no_items_avail'> <td> There are no
Hi there I have an SQL table that looks like this: CREATE TABLE IF
We have a table with tree structure like this: Id Desc ParentID === A
I have three tables as follows, Table1- num |info ---------- 1 |aaaaa 2 |bbbb

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.