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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:11:58+00:00 2026-05-11T13:11:58+00:00

I have a database of company registrants (for a search/directory functionality). We’ve added a

  • 0

I have a database of company registrants (for a search/directory functionality). We’ve added a new table to hold ‘enhanced’ information for registrants that pay for this feature (such as advertisements/additional images/logos etc). Right now the new table just holds the registrants unique identifier, and a few additional fields (paths to images etc). A user can search for users with specific criteria, and the enhanced listings should appear at the top of the list. The results should not show any registrant twice (so if a user has an enhanced listing they should only appear in the top ‘enhanced listing’ area). How can I accomplish this?

  • 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. 2026-05-11T13:11:59+00:00Added an answer on May 11, 2026 at 1:11 pm

    Left outer join from the old table to the new table.

    Prepend to your query’s ‘order by’ ‘case when new_table.id is null then 1 else 0 end’

    So if you had this:

    select foo, bar from old_table  order by bar, foo; 

    You’d have this:

    select a.foo, a.bar from old_table a   left join new table b on (a.customer_id = b.customer_id)  order by   case when new_table.customer_id is null then 1 else 0 end,   bar, foo; 

    Edit: I left out the ‘left’ from the outer join in the code.

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

Sidebar

Related Questions

Our scenario: We have a main database that stores company-wide information. We have several
At my company we have a database with one table being so big that
I have a database that has 4 tables. Table 1 - company table with
that my problem: I have database table like that: id (AI) market_id 1 6
I have a database table in SQL Server 2005 Express that takes in 2367
I have a master database, that has a table ( companyTable ) stores the
I have a Database containes information about all the branches of our company around
I have two tables in my database: Company table (ID, CompanyName, CompanyUsername, CompanyPassword) Employee
Alright, so let's say I have a database with a table named COMPANY_PARAMETERS that
I have this big database table that tracks (currently in production), a persons medical

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.