|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Query Assistance Required
Hello all,
I am looking for some query help. I have two tables involved, so sounds nice and easy. Table 1 ------------------------------------------------------------------------------------------ Column Name | Constraint | Column Type | Description condition_id | P | varchar2(36) | Key field to identify the condition. text_id | N, F | varchar2(36) |Key field to identify the corresponding text ------------------------------------------------------------------------------------------- Table2 ------------------------------------------------------------------------------------------ Column Name | Constraint | Column Type | Description text_id | N, U | varchar2(36) | Key field to identify the text. order_number | N, U | number(5) |Order number of this text part. text_part | U | varchar2(254) | Part of the text. ------------------------------------------------------------------------------------------- My constraints are P for primary key, F for foreign key, N for NOT NULL & U for the unique column or the combination of unique columns must be unique. Note, however, that all or some columns of the unique constraint may be NULL. NULL is considered for uniqueness. Basically each row from table1 might have an enter in table2. If it does have an entry and the text being stored is under 254 characters it will be in one part else its in two or more and joined based on the order number. My question is how do I always return the text. In some cases it might have 20 characters and in others its 600. So basically the text is split if its greater than 254 and stored in mutiple rows and I need a query to rejoin them all back together based on the condition_id and text_id. Any help would be great. |
|
#2
|
||||
|
||||
|
Just select the columns with some pipes "||" in between, that will make them one value. You could also use the concat() function, but using it for more than two values gets messy.
__________________
The liver is evil and must be punished! |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Query Assistance Required |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|