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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:45:14+00:00 2026-06-15T03:45:14+00:00

I want to be able to extract two sets of data in one script

  • 0

I want to be able to extract two sets of data in one script with a total of 15 records.

In my scenario, I extract members from a certain town which for example could return 3 records, and then I want to extract the remaining 12 from that particular state.

Here is a coding sample:

SELECT MemberID, a.UserName, a.MemberDisplayName, a.NYKABizName, a.PackageType
FROM Member a
WHERE a.Claimed = 'Y'
AND a.PrCity = 'Bridgewater'
AND a.PrStateID = 36
AND a.PackageType = 'E'
ORDER BY a.MemberDisplayName

SELECT MemberID, a.UserName, a.MemberDisplayName, a.NYKABizName, a.PackageType
FROM Member a
WHERE a.Claimed = 'Y'
AND a.PrStateID = 36
AND a.PackageType = 'E'
ORDER BY a.MemberDisplayName

I dont want these two combined into one, I want a temporary virtual table where the results are stored and then the virtual table is returned once complete.

Any ideas how one can accomplish this?

Many thanks in advance,
neojakey

  • 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-15T03:45:16+00:00Added an answer on June 15, 2026 at 3:45 am

    Your virtual table would look like this

    CREATE VIEW view_name AS
        SELECT * FROM
        (
        SELECT MemberID, a.UserName, a.MemberDisplayName, a.NYKABizName, a.PackageType
        FROM Member a
        WHERE a.Claimed = 'Y'
        AND a.PrCity = 'Bridgewater'
        AND a.PrStateID = 36
        AND a.PackageType = 'E'
        ORDER BY a.MemberDisplayName
        ) x 
        UNION 
        (
        SELECT MemberID, a.UserName, a.MemberDisplayName, a.NYKABizName, a.PackageType
        FROM Member a
        WHERE a.Claimed = 'Y'
        AND a.PrStateID = 36
        AND a.PackageType = 'E'
        ORDER BY a.MemberDisplayName
        ) y
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to extract text from text files as tokens -
I'm looking for a solution for how to be able to extract data from
I want to be able to extract all cells under a certain column with
I want to be able to extract text from received SMS's. I'm not sure
I am able to parse the HTML but I want to extract the warning
I want to be able to hide a selector if it contains any data.
I want to extract the lines between one given and one more or less
I have a table containing two columns in SQL that I want to extract
Currently I am able to populate my spinner two ways one way gives me
I'm trying to build a parser that would be able to extract the 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.