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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:36:00+00:00 2026-06-11T02:36:00+00:00

I would like to create the following table (table 1): CHANNEL START STOP SIGNAL

  • 0

I would like to create the following table (table 1):

CHANNEL    START    STOP    SIGNAL    NOISE
-------------------------------------------
chan1      0        1       A         B
chan2      10       20      C         D
...

from the following table (table 2):

CHANNEL    START    STOP    TYPE      VALUE
-------------------------------------------
chan1      0        1       signal    A
chan1      0        1       noise     B
chan2      10       20      signal    C
chan2      10       20      noise     D
...

I am trying to create a select query to grab the relevant information from table 2 and create table 1 out of it. I will then turn this into a view.

I am essentially lost at this point. I tried doing the following:

select distinct 
    table2.CHANNEL as CHANNEL_ID
    , table2.START as START_FREQ
    , table2.STOP_FREQ as STOP_FREQ
    , SIGNAL = CASE
      WHEN table2.TYPE = 'signal' THEN table2.VALUE
      END
    , NOISE_OFFSET = CASE
      WHEN table2.TYPE = 'noise' THEN table2.VALUE
      END

from 
    table2

This gives interesting results, but it is clearly not what I want. I understand this is the wrong query, and I should probably do this using joins, but when I went that route the query would not execute. I am having a brain fart here and help would be very much appreciated. 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-06-11T02:36:02+00:00Added an answer on June 11, 2026 at 2:36 am

    You are looking for this:

    SELECT
          A.CHANNEL AS CHANNEL_ID,
          A.START AS START,
          A.STOP AS STOP,
          A.VALUE AS SIGNAL,
          B.VALUE AS NOISE
    FROM
          table2 as A
          JOIN table2 as B
          ON 
              A.CHANNEL = B.CHANNEL AND 
              A.START = B.START AND 
              A.STOP = B.STOP AND
              A.TYPE = 'signal' AND
              B.TYPE = 'noise'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a view from the following table. This table contains
I would like to create a query that returns rows in the following format:
i have the following problem: i would like to create a footer. that footer
I have the following actor for which I would like to create unit tests
I would like to create a c++ type that mimic the build-in type exactly.
I have the following table with the value 501 in it.. CREATE TABLE _Numbers(
I would like to create a SQL query, which does the following.. - I
I would like to create a LINQ query which results in the following SQL
Let's say I have the following array: [['a'],['b'],['c']] I would like to create 3
Please see the following example table. I would like to count the 1's in

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.