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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:12:34+00:00 2026-05-31T06:12:34+00:00

In a database a certain user has four levels of access to data. Each

  • 0

In a database a certain user has four levels of access to data. Each level he has, is stored in a database record with the userID and the access level as a string. (This is not good design, but this is what I have to work with.) When a person has a certain level of access, it automatically has all lower levels. So if a person has level 3, there are three database records for it. The strings are abbreviations of what the level allows, so, it is impossible to simply use the MAX-function

Now I have to write an other program, using the same database and I want to write an SQL-statement that only gets the highest level per person, without having to change the database (so the other program won’t crash).

The database is MySQL.

  • 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-05-31T06:12:35+00:00Added an answer on May 31, 2026 at 6:12 am

    Create a temporary table that can join to the user table and associates the access levels (in strings) to integers. You can then use MAX on that integer column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose each user has certain preferences that is saved in database for that user.
We have a web application that gets its data from a certain database. The
I'm looking at having certain users access one database and other users accessing another
I have a database which holds the residents of each house in a certain
I am working on a website which already has user access set up so
I have a grid view displaying the messages a user has. Each message the
I'm trying to figure out how big a certain database would be (it hasn't
I created a query that takes a database backup at certain specified location. I
Often you need to show a list of database items and certain aggregate numbers
Is there a way to pre allocate my SQLite database to a certain size?

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.