Select the problem
HelloI have the following table t1 with data such as
col1
test
23
3
45
13
6
test2
9
89
67
23
test3
78
23
22
How to make a table with 2 columns samecol1 col2
test test
23 test
3 test
45 test
13 test
6 test
test2 test2
9 test2
89 test2
67 test2
23 test2
test3 test3
78 test3
23 test3
22 test3
The string value of col1 should be the parent.Thank you
Maybe NOT TESTED
select col1,
last_value(col2) ignore nulls over (order by the_order nulls last) col2 /* 11g */
/* last_value(col2) ignore nulls) over (order by the_order nulls last) col2 -- below 11g */
from (select col1,
case when col1 like 'test%'
then col1
end col2,
row_number() over (order by null) the_order
from your_table
)
order by the_order
Concerning
Etbin
Tags: Database
Similar Questions
-
Select the problem with expressions
Hello
I use Teststand 4.0 and a frustrating problem with the Select Case statements.
I have attached a sequence that shows the problem.
A loop from 0 to 10.
The select case statement should decide which box 3 instructions corresponds to the expression and a message box is displayed.
However the Basic program reacts as expected.
First, he made his entry with a value of 0, it goes to the > 7 stated case.
The second time, he enters the loop with a value of 1, it will correctly to the<3 case="">3>
The other values of 2 to 10 enter no case statement.
Is this a bug in TS 4?, or I do something wrong?
Thank you
Mike
The problem is that you compare the Locals.New_Val of the Locals.New_Val property.< 3". ="" if="" those="" two="" properties="" match,="" then="" it="" will="" execute. ="" if="" you="" wanted="" that="" particular="" case="" to="" execute="" when="" locals.new_val="" is="" 0,="" you="" would="" just="" type="">
Unfortunately there is no way to have multiple cases of a single block of code.
In C, you could do it like this:
Switch (newVal)
{
case 0:
case 1:
case 2:
do something
break;
case 3:
case 4:
case 5:
case 6:
case 7:
do something else
break;
etc...
}
Even in C, it's awkward, and you would probably do the following instead:
If (newval<>
do something
Else if (newval<>
do something else
on the other
do something else
The reason why it works in TestStand, is that expressions will try to automatically convert types if she can do it. false is logically equivalent to 0 and true, it is logically equivalent to 1, so what you are really comparing to in your case statement is your property (Locals.New_Val) to a Boolean expression that evaluates to 0 or 1. It is certainly not obvious when we look at, but at least, this explains why it happens. Another way, you could do this is to change "Point to compare" step of the 'True' selection, which will each case in order to compare the expression of the value 'true '. I still recommend a structure if/else if/else for this kind of problem because it's easier to read, but it is possible to do what you want in this case with a select / box.
P. Allen
NEITHER
-
SELECT, update, SELECT the problem
Hello world
I am very new to working with Oracle with .net and I am a bit confused by something, so I hope someone can help me...
The situation is that I have 3 commands. The first selects a row in a table ("SELECT field1, Field2 FROM table1 WHERE Field1 is 1'), then Field2 = 'foo '. The second command updates the same line in this table ('UPDATE table1 SET Field2 = 'bar' WHERE field1 = 1'), then the third makes a selection re (('SELECT champ1, champ2 FROM table1 WHERE champ1 = 1').) The problem I have is that the third command bring me the same results that firstly, unchanged - even if I see this line in the database and I KNOW He is changed, and the second command worked. Field2 = always "foo"... If I refresh and refresh a couple of times, data is changed later.
Here is a code...
DataTable Table = new DataTable();
OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();
OracleDataAdapter adapter = new OracleDataAdapter ("SELECT field1, Field2 FROM TABLE1 WHERE FIELD1 = 1, conn);
Set DataSet = new DataSet();
adapter. Fill (Set);
Table = all. Tables [0];
It's all right, I get what I expect, IE: Field2 = 'FOO '...
So now, I am doing this...
OracleParameter Field2Param = new OracleParameter ("Field2", OracleDbType.Char, 64, "BAR", ParameterDirection.Input);
OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();
OracleCommand cmd = new OracleCommand (insertstr, conn);
OracleTransaction txn is conn. BeginTransaction (IsolationLevel.ReadCommitted);
cmd. Parameters.Add (Field2Param);
cmd ExecuteNonQuery());
.. .This works also, depending on the point of view of database.
So I update in the same way as before...
DataTable Table = new DataTable();
OracleConnection conn = new OracleConnection ("User Id = database; Password = password; Data Source =');
Conn. Open();
OracleDataAdapter adapter = new OracleDataAdapter ("SELECT field1, Field2 FROM TABLE1 WHERE FIELD1 = 1, conn);
Set DataSet = new DataSet();
adapter. Fill (Set);
Table = all. Tables [0];
.. .but I still get Field2 as 'FOO '...
Help, please...Hello
Complete code would help here, because I can't tell where you are finishing the explicit transaction and data validation. Can you reproduce the complaint if you all back to back sequentially in a console application standalone with all the code inside the HAND, for example?
Here is my proposal, if: call you con. Open several times, so the second or 3rd con. Open call receives a different connection of the pool, rather than you use only and did not commit the transaction again so that it is visible to other connections.
Also, if your db is RAC, it is also delay spread of validation that can prevent the data to be visible in the other nodes, if your code is running in a tight loop and you are connected to another node.
It will be useful,
GregPublished by: gdarling on June 27, 2011 11:25
-
Select the problem with joined tables
Hello everyone I have the following query
The problem I have is any WHERE clause I use I have double values that makes no sense. I checked in the tables and I not all double values. Each Opremljenost has 1 objekat (there are 2 rows of each with its own Objekat) and this applies to 2 other tables (PONUDE and TEHNICKE OPREMLJENOSTI), but for some reason any that they double values. If I run it without a where clause at all clause, I get a repetition of values itself up to 4 times. Does anyone have an idea what's wrong with my request?SELECT OBJEKTI.OBJEKAT_ID OBJEKAT_ID, OBJEKTI.ADRESA ADRESA, OBJEKTI.POVRSINA POVRSINA, OBJEKTI.BROJ_IZVRSILACA BROJ_IZVRSILACA, OPREMLJENOSTI.OPREMLJENOST_ID OPREMLJENOST_ID, OPREMLJENOSTI.PULT PULT, OPREMLJENOSTI.REKLAMA REKLAMA, OPREMLJENOSTI.MOKRI_CVOR MOKRI_CVOR, OPREMLJENOSTI.WC_ZA_IGRACE WC_ZA_IGRACE, OPREMLJENOSTI.WC_ZA_OSOBLJE WC_ZA_OSOBLJE, OPREMLJENOSTI.VENTILATOR VENTILATOR, OPREMLJENOSTI.OSVJETLJENJE OSVJETLJENJE, OPREMLJENOSTI.VRSTA_BROJILA VRSTA_BROJILA, OPREMLJENOSTI.ELEKTRO_INSTALACIJE ELEKTRO_INSTALACIJE, OPREMLJENOSTI.VODO_INSTALACIJE VODO_INSTALACIJE, OPREMLJENOSTI.TELEFONSKE_INSTALACIJE TELEFONSKE_INSTALACIJE, OPREMLJENOSTI.GRIJANJE_ID GRIJANJE_ID, OPREMLJENOSTI.POD_ID POD_ID, OPREMLJENOSTI.PROZORI_VRATA_ID PROZORI_VRATA_ID, OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID1, TEHNICKE_OPREMLJENOSTI.TEH_OPR_ID TEH_OPR_ID, TEHNICKE_OPREMLJENOSTI.ONLINE_KLADIONICA ONLINE_KLADIONICA, TEHNICKE_OPREMLJENOSTI.PANO PANO, TEHNICKE_OPREMLJENOSTI.NOSACI NOSACI, TEHNICKE_OPREMLJENOSTI.TV_LCD TV_LCD, TEHNICKE_OPREMLJENOSTI.TV_TELETEXT TV_TELETEXT, TEHNICKE_OPREMLJENOSTI.APARATI_IGRE APARATI_IGRE, TEHNICKE_OPREMLJENOSTI.EVONA EVONA, TEHNICKE_OPREMLJENOSTI.NOVOMATIC NOVOMATIC, TEHNICKE_OPREMLJENOSTI.RULET RULET, TEHNICKE_OPREMLJENOSTI.BILIJAR BILIJAR, TEHNICKE_OPREMLJENOSTI.KLIMA KLIMA, TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID2, PONUDE.PONUDA_ID PONUDA_ID, PONUDE.ONLINE_TERMINAL ONLINE_TERMINAL, PONUDE.SRECKE SRECKE, PONUDE.ONLINE_KLADIONICA ONLINE_KLADIONICA1, PONUDE.APARATI_IGRE APARATI_IGRE1, PONUDE.RULET RULET1, PONUDE.BILIJAR BILIJAR1, PONUDE.OBJEKAT_ID OBJEKAT_ID3 FROM OBJEKTI, OPREMLJENOSTI, TEHNICKE_OPREMLJENOSTI, PONUDE WHERE (PONUDE.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID) OR (OPREMLJENOSTI.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID) ORDER BY OBJEKTI.OBJEKAT_ID
Well, if all relationships are to 1-1 (1-0), then try this (the names of table/column, but you get what I mean bad):
select OBJ.*, OPR.*, TEH.*, PON.* -- I know you can't do this, but you get what I mean. from OBJ,OPR,TEH,PON where OBJ.object = OPR.object (+) and OBJ.object = TEH.object (+) and OBJ.object = PON.object (+) /
its supposed to be a 1 to 1 relationship, but it is not.
In this case the remedy is very simple: create a UNIQUE constraint on the column of the OBJECT in OPR, TEH and PON...
-
Select the problem posed by the query?
Hello
I use 10g and here is my example query adds nothing. I know there are records in the database. It must be linked with my date conversions.
SELECT a.gm_cd, a.draw_cd, NVL (b.cpns, 0) cpns, NVL (b.clms, 0) SSAC, NVL (b.amn, 0) amn FROM (SELECT gm_cd, draw_cd, TO_DATE (draw_tm, ' DD/MM/YYYY') draw_tm TO draw WHERE gm_cd = 10105 AND TO_DATE (draw_tm, ' DD/MM/YYYY') = TO_DATE (sysdate-1, ' DD/MM/YYYY')) a, (SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind 0)) cpns) (, SNSOT SUM (a.clms* b.sing_ind), amn SUM (a.amn* b.sing_ind) OF draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105) b ORDER BY a.gm_cd, a.draw_cd
Any ideas?
Furthermore, draw_tm is a column DATE (05/11/2013 03:59:59) and the DT is also a column DATE (10/05/2013)raysefo wrote:
HelloI use 10g and here is my example query adds nothing. I know there are records in the database. It must be linked with my date conversions.
SELECT a.gm_cd, a.draw_cd, NVL (b.cpns, 0) cpns, NVL (b.clms, 0) SSAC, NVL (b.amn, 0) amn FROM (SELECT gm_cd, draw_cd, TO_DATE (draw_tm, ' DD/MM/YYYY') draw_tm TO draw WHERE gm_cd = 10105 AND TO_DATE (draw_tm, ' DD/MM/YYYY') = TO_DATE (sysdate-1, ' DD/MM/YYYY')) a, (SELECT SUM (DECODE (a.from_draw, a.to_draw, a.cpns * b.sing_ind 0)) cpns) (, SNSOT SUM (a.clms* b.sing_ind), amn SUM (a.amn* b.sing_ind) OF draw_sales a, ACC_TYPE b WHERE a.tp = b.cd AND a.DT = TO_DATE(sysdate-1, 'DD/MM/YYYY') AND a.gm_cd = 10105) b ORDER BY a.gm_cd, a.draw_cd
Any ideas?
Furthermore, draw_tm is a column DATE (05/11/2013 03:59:59) and the DT is also a column DATE (10/05/2013)
If draw_tm is a DATE data type, then you shouldn't do a TO_DATE on it, as you don't need to convert it to a date. If you try to remove any component "hour" of him, then you must use TRUNC (draw_tm).
Similarly, with sysdate, you must use TRUNC to truncate. Never use TO_DATE datatypes in other data you causes an implicit conversion in varchar2 who depend on your NLS settings and may fail.
-
I installed the download tool usb/dvd windows 7, but after you have selected the iso file when I insert the USB stick and refrecing, it does show that "no usb drive compatible' what is the problem with my USB
I have sandisk cruzer blade USB key
Hi Rohit,
Thanks for posting your query in Microsoft Community Forum. I understand that your USB drive is having problems of compatibility with your computer, but I would like to learn more about the issue in order to provide you with better assistance.
- You did it any significant hardware or change software on the computer before this problem?
- When do you get exactly the error message?
- Have you tried to connect to any other computer on this flash drives?
- Your USB key works on other computers or have you tried to connect to different USB ports on this computer?
- Is the pen drive getting detected in the case or you are able to access the drive folder in the window of the computer ?
The question may arise if the currently loaded USB driver has become unstable or damaged, or if your PC requires an update for problems that could conflict with a device USB and Windows. This can also occur if your USB controllers may have become unstable or corrupt. So, I would suggest trying the following steps and check if the problem persists.
Method 1:
Please try the fixit (s) provided below which will help you solve common problems associated with devices and USB ports.
- Hardware devices do not work or are not detected in Windows
- Diagnose and automatically fix the Windows USB problems
If method 1 does not work, try Method 2.
Method 2:
Remove and reinstall all USB controllers.
- Open Manager devices by clicking the Start button, click Control Panel, click system and security, and then, under System, clicking Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
- In the list of the categories of equipment, locate and expand Bus USB controllers.
- Right-click every device under the Bus USB controllers node and then click Uninstall to remove them one at a time.
- Restart the computer and let the USB controllers get reinstalled.
Plug in the removable USB device and test to make sure that the problem is solved.
If the problem persists, go to method 3.
Method 3:
This method will install the latest drivers from device to your USB device.
- Click the Start button, type Windows Update in the search box, and then click Windows Update in the results pane.
- Click find updates. When the scan finished, click optional review updates.
- Click the check box next to the update, and then click install updates.
- If you are prompted, read the license agreement, then click I agree.
- Follow the instructions on the screen to download and install updates.
- If you are prompted, restart your computer.
More information: Update a hardware driver that is not working properly
Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.
-
Yesterday, I had no problem. Today, I was unable to choose fonts of various sizes. No matter the size, that I select, the police remains very, very small and unreadable. Have I got something done inadvertently that would help my problem? I thank for information, you may be able to provide!
Sincerely,
taylormadein48
maxiew14436389 wrote:
Yesterday, I had no problem. Today, I was unable to choose fonts of various sizes. No matter the size, that I select, the police remains very, very small and unreadable. Have I got something done inadvertently that would help my problem? I thank for information, you may be able to provide!
Sincerely,
taylormadein48
Please include your OS version, Windows or Mac and which version?
What kind of display? (height and width in pixels and size in inch/cm)
You are in the editor or organizer?
-
I have download and install creative cloud with no problems. In the window of creative cloud cannot display the APPS page (while other 'Home', 'Community' can be seen. This is why I can't select the application to be updated. Thanks for your help
Please refer to the threads below where the issue has been addressed:
-
I have problems, adding comments using Adobe reader DC on my pro 3 surface. I can select the circle for example, but when I try to draw the circle nothing happens and the screen just scrolls in the direction I move the pointer?
Hey paulc6148125,
Please try the mode settings different button in Adobe Acrobat Reader DC-> leModifiermenu-> preferences-> general categories.
Kind regards
Nicos
-
The problem of the object selection
Hello. I'm pretty new to Illustrator, and I'm frankly quite easily frustrated. I only used Photoshop in the past.
Here's my problem. I did a logo in Photoshop but "strokes" sucks, and I want a sharp edge. That's why I want to 'offset '.
But I can't select the option and also select my object as I see it is in the tutorials.
Here is a picture of what I mean, I can't get an adequate selection around the logo itself.
http://i1024.Photobucket.com/albums/y307/OfficerNice/fuckinglogo_zpsta2e2mpy.PNG
Don,
Path of compensation works only with the traces.
You can Trace the logo Image, have ignored done white TIC TACS and then expand the Trace of the Image. After that, you can use offset path.
The question is if you get the clean look and accurate this way.
You can consider new path with the tool pen on top of the raster image locked.
-
Cannot set keyframes in the audio clip selected with the pen tool - cannot see even the line volume control more to set keyframes on having developed the clip. What could be the problem? I use the first CC pro @.
You can use the Ctrl key and then click with the regular selection tool, clicking with ctrl will make a new keyframe. in this way, have no need for the tools. CTRL has other great shortcuts that will stop you having to spend retouching pads tools too.
If the automation keyframe line is missing, you can switch on and off in the menu sequence.
-
Hello I am a student and I have a problem with the tool Selection (V). When I opened the file AI CC with CS6 selection tool doesn't allow me to change the selection. What can I do? (I have reinstall AI CC and the problem persists)
Ivan,
If it's on the rectangular objects, you may have encountered the bug Rectangle Live which is limited to the MAC versions from 10.7 and 10.8, but not of 10.9 (Mavericks) or 10.10 (Yosemite). If all goes well, the bug will be fixed soon.
Thus, a switch for the Mavericks or Yosemite with a reinstall might be the way to solve it here and now.
To get around it, in each case, it is possible to develop direct Rectangles to get the normal old shaped rectangles or Pathfinder > unit, or use the scale tool or the free transform tool.
A more permanent way round that is to create normal old shaped rectangles, after running the free script created by Pawel, see this thread with download link:
-
Insert the problem using a SELECT table with an index by TRUNC function
I came across this problem when you try to insert a select query, select returns the correct results, but when you try to insert the results into a table, the results are different. I found a work around by forcing a selection order, but surely this is a bug in Oracle as how the value of select statements may differ from the insert?
Platform: Windows Server 2008 R2
11.2.3 Oracle Enterprise Edition
(I've not tried to reproduce this on other versions)
Here are the scripts to create the two tables and the data source:
Now, execute the select statement:CREATE TABLE source_data ( ID NUMBER(2), COUNT_DATE DATE ); CREATE INDEX IN_SOURCE_DATA ON SOURCE_DATA (TRUNC(count_date, 'MM')); INSERT INTO source_data VALUES (1, TO_DATE('20120101', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120102', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120103', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120201', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120202', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120203', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120301', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120302', 'YYYYMMDD')); INSERT INTO source_data VALUES (1, TO_DATE('20120303', 'YYYYMMDD')); CREATE TABLE result_data ( ID NUMBER(2), COUNT_DATE DATE );
You should get the following:SELECT id, TRUNC(count_date, 'MM') FROM source_data GROUP BY id, TRUNC(count_date, 'MM')
Now insert in the table of results:1 2012/02/01 1 2012/03/01 1 2012/01/01
Select the table, and you get:INSERT INTO result_data SELECT id, TRUNC(count_date, 'MM') FROM source_data GROUP BY id, TRUNC(count_date, 'MM');
The most recent month is repeated for each line.1 2012/03/01 1 2012/03/01 1 2012/03/01
Truncate your table and insert the following statement and results should now be correct:
If someone has encountered this problem before, could you please let me know, I don't see what I make a mistake because the selection results are correct, they should not be different from what is being inserted.INSERT INTO result_data SELECT id, TRUNC(count_date, 'MM') FROM source_data GROUP BY id, TRUNC(count_date, 'MM') ORDER BY 1, 2;
Published by: user11285442 on May 13, 2013 05:16
Published by: user11285442 on May 13, 2013 06:15Most likely a bug in 11.2.0.3. I can reproduce on Red Hat Linux and AIX.
You can perform a search on MOS to see if this is a known bug (very likely), if not then you have a pretty simple test box to open a SR with.
John
-
Problems to use the cursor to select the format of pdf text precisely
When you try to select a bit of text that is in a text (as opposed to a text box) on a form object, the cursor highlights several other items of text on the page.
I'll try to reproduce it below:
It is just the nature of the documents in pdf format, or is this something that can be avoided.
I made sure to give each its own name text object, but the problem persists.
Let's say that I tried to highlight all the end of this sentence.
Note that the other texts are selected as well. This would happen in a form when I would try to select only the text: "the end of this sentence."
Its not impossible to select the text I want in acrobat, but it seems to be very sensitive on the forms. Just to have the cursor slightly outside the central axis of the text, and half of the shape is selected.
Is it possible to make it more like the text in a text field?
Thank you!
Nope!
It's just the way it is.
Niall
-
Workflow problem - how to stop Illustrator by selecting the top layer after each record?
Hello
One of the great things about diapers is the ability to have items in a locked layer above the layer you are using. However, when Illustrator finishes savings, he selects the layer and if the layer that is locked and then you travel constantly in the layers palette to select the layer that you worked prior to backup - I need to that 50 - 100 times per hour.
Is there a way to force Illustrator to remember you were working before the backup - and bring him back to this layer after layer save him?
Any pointers in the right direction would be much apprciated.
See you soon
Ben
Yo know what - I think this may have something to do with having "Create a PDF compatible" off in la - like preferences.
It seems that when this option is enabled, the problem does not occur, but turn it off makes it - I just tried this on a whole new file with text and boxes.
It's the same for you guys?
Maybe you are looking for
-
Inadvertently, I installed easy doc merge, how can I get rid of this?
I downloaded easy doc fusion and I can't get rid of it, no matter what I do. Anyone who has knowledge of this?
-
EliteBook 8570w: upgrade the workstation database model Mobile here 8570w
So, I want to upgrade my EliteBook 8570w. It was a school issued laptop that I have the opportunity to keep or "modernization" of the year next to the Zbook. The Zbook we saw, and frankly it's a slope down what I have now. That being said I'll opt
-
Microsoft keyboard takes a long time to open the Favorites
I have a Microsoft ergonomic Natural Keyboard 4000, it works great but there is this problem that I can not get rid. all keys work properly, same custom and all functions, but the shortcut 5 Favorites buttons on top that I attributed to 5 different s
-
Clear FilterableQueryDescriptor using JavaScript onLoad page
Jdev: 12 cProblem: I have a method that deletes the filter criteria, but I need the criteria on page load, the method of some clear I have to help in the server listener I button, but in button, this works perfectly:Method ServerListener:{} public vo
-
How can I recursively parse an xml using XQuery document?
I have an open and I have to using XQuery in Response.xml can transform someone give me an idea how to analyze recursive Xml using XQuery documents. Any help will be appreciated. Thanks in advanceOpen" < = xmlns:ns0 ns0:GlobalRoutePlanServiceGOPRespo