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

The Archive Base Latest Questions

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

I have a table with a job # and a suffix. The query i’m

  • 0

I have a table with a job # and a suffix. The query i’m trying to create selects a range of job # / suffix entries where the suffix is dependant upon the job #. So for example:

Job #              Suffix
--------           -----------
00000001           001
00000001           002
00000001           003
00000002           001
00000002           002
00000002           003
00000002           004
00000003           001
00000003           002
00000003           003
00000003           004

I have four inputs. One pair is the starting job / suffix and then the ending job / suffix. If the user inputs:

Starting: 00000001 / 002

Ending: 00000002 / 002

They’ll get the following results:

Job #              Suffix
--------           -----------
00000001           002
00000001           003
00000002           001
00000002           002

I want to know if there’s a simple way to do this in one select statement in my stored proc. The only way I thought to do it so far would be to select the jobs first into a table variable then filtering the suffix with another query.

This seems simple, but having difficulty wrapping my brain around this one.

Thanks!

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

    I’m not totally sure what you’re trying to do, but a quick guess is something like this..

    SELECT * FROM tbl
    WHERE ( job + suffix*0.001 )
    BETWEEN (starting_job + suffix*0.001) AND (ending_job + suffix*0.001)
    

    This works, because it seems as if suffix is minor number. Essentially, you’re serializing to “job.suffix” and selecting where you between the range of the set. If you can, create an index on (start_job + suffix*0.001). This also assumes suffix is of numeric(3)

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

Sidebar

Related Questions

I have two table like this job(id,title,location,...) job_page(id,id_job,id_page,page_name) For example I want to write
I have a Job table and a Contact table, I need to create another
I am trying to do the following: I have a table with ename, job,
I have a table named job and is not plural but I was wondering
I have a table that looks like this: Name Job Year ImpFile ImpDate ------------------------------------------------
I have a simple map/reduce job that scans one hbase table, and modifies another
I have table and this table contain result column with some entries. I just
I have a job table that holds jobs and leaddate is the field for
I have a database table, with people identified by a name, a job and
I have a log table that contains job status. One of the columns is

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.