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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:24:05+00:00 2026-06-13T20:24:05+00:00

table1 value 100 x 200 x 300 x 400 `I want to split this

  • 0

table1

value

100 x 200 x 300 x 400  `I want to split this row bcoz more than 2 values`
100 x 200
1300 x 1400
200 x 300 x 1200 x 2200  `I want to split this row bcoz more than 2 values`
....

Value column is not fixed length, it may also contain 10 x 200 x 3000 x 5

I want to take the first 2 values then the next 2 values will go to the next row after x

I want to split the rows like this:

Expected Output

100 x 200 
300 x 400
100 x 200
1300 x 1400
200 x 300 
1200 x 2200
....

Hint:

We can split the value for each x then we can join 2 values

for example 20 x 10 x 5 x 1

Split like this 20, 10 5, 1 then join 20 x 10, 5 x 1

The above method will work out, if it work out means then can i get some query for splitting and joining the rows..

How can I do this in SQL?

Need SQL Query Help

  • 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-13T20:24:08+00:00Added an answer on June 13, 2026 at 8:24 pm

    Working Link

    SELECT Rtrim(Substring(value, 1, CHARINDEX( 'x' , value, CHARINDEX( 'x', value) + 1) - 2))
    FROM (SELECT value
        FROM table1
        Where LEN(value) - LEN(REPLACE(value, 'x', '')) >= 2) as temp
    UNION ALL 
    SELECT Substring(value, CHARINDEX( 'x' , value, CHARINDEX( 'x', value) + 1) + 2, LEN(value))
    FROM (SELECT value
    FROM table1
    Where LEN(value) - LEN(REPLACE(value, 'x', '')) >= 2) as temp1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following table ColID Value A 100 B 200 C 300 D 400
Table1 id value --------- 1 100 2A 200 2 300 10 500 8 200
Using Access 2003 Table1 ID Name Value 001 Raja 100 002 Ramu 200 004
Using VB.Net and SQL Server Table1 Id Value ..... 1001P0010001 100 1001P0010002 200 1001P0010003
Using Access 2003 Table EmpID Value1 Value2 001 100 001 300 001 200 400
I have a table in database as follows... ID(INT) Values(VARCHAR(50)) 1 200,300 2 100
In a table such as this: FK-----Value 01-----100 02-----50 02-----150 03-----50 03-----50 How can
I have these tables and values: Table1 ------------------------ ID | Value ------------------------ 2 |
I have this table : TABLE Transaction Trans_ID Name Value Total_Item 100 I1 0.33333333
I've CSV string 100.01,200.02,300.03 which I need to pass to a PL/SQL stored procedure

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.