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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:38:04+00:00 2026-06-12T12:38:04+00:00

I have two types of customers in a table, privileged and normal users. When

  • 0

I have two types of customers in a table, privileged and normal users. When I select some column values from the customers table I want default values for normal users whereas I need actual values for privileged users.
query:

select name,id,budget,employees,duration from customers
where reg_date >= to_date( '01-SEP-2012','dd-mmm-yyyy') 
  and reg_date <= to_date('01-OCT-2012','dd-mmm-yyyy')

For normal users I need the values of budget, employees, duration columns as 0.

I have to query another table by ‘id’ and ‘reg_mode’ to check if a user is privileged user or not. I may be advised that I should have a column in customers table to include ‘type’ of the customer. Unfortunately I am not authorized to modify the tables. Any ideas to pull the values with lesser latency?

  • 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-12T12:38:06+00:00Added an answer on June 12, 2026 at 12:38 pm

    Not sure if I got it, specially because the tables structure is not so clear…
    Lets suppose the other table name is user_type. I suppose what you want is (note my query can have minor errors since I didn’t try, I just want to give an idea of the structure):

    select name,id, '0' as budget, '0' as employees, '0' as duration from customers 
    inner join user_type on
           customers.id = user_type.id
    where reg_date >= to_date( '01-SEP-2012','dd-mmm-yyyy')  
      and reg_date <= to_date('01-OCT-2012','dd-mmm-yyyy') 
      and user_type.reg_mode = 'normal'
    
    union
    
    select name,id, budget, employees, as duration from customers 
    inner join user_type on
           customers.id = user_type.id
    where reg_date >= to_date( '01-SEP-2012','dd-mmm-yyyy')  
      and reg_date <= to_date('01-OCT-2012','dd-mmm-yyyy') 
      and user_type.reg_mode = 'privileged'
    

    Inner join is similar to where, please let me know if you have questions regarding that terminology…

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

Sidebar

Related Questions

I have two types of users for my system, normal human users with a
I have two types of users on the database: -Web registered users -Twitter users
I have two different list types. I need to remove the elements from list1
I have two types of accounts (customer and provider), I chose the single-table strategy
I have two tables, jos_eimcart_customers_addresses and jos_eimcart_customers. I want to pull all records from
I have two tables in SQL server for customers and their addresses. CREATE TABLE
I have two types of registration, registration A and registration B, each will have
I have two types of data sets. Both are in same size. One contains
If I have two types of strings as: const char *str1 = This is
So, I have two types at the moment: const unsigned char* unencrypted_data_char; string unencrypted_data;

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.