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 a table story_category in my database with corrupt entries. The next query
I have table with 50 entries (users with such details like Name Surname Location
While trying to use LINQ to SQL I encountered several problems. I have table
I have two table: job with jobid, jobdescription, etc and user with userid, jobid,
I am new to SQL programming. I have a table job where the fields
I have a job table Id ParentID jobName jobStatus The root ParentID is 0.
Say I have a Queue table and a Job table. In the Job table
I have a database table, with people identified by a name, a job and
I have a Job Register Table and that table doesn't have any records. This
i have table consist of columns : id,name,job and i have row stored with

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.