How to add the number of the column by another county sql statement
My problem is
SELECT Count (DISTINCT num) OF tmp_table;
the foregoing will return 13.
UPDATE seq_table a SET a.currentvalue = a.currentvalue + 1 + (SELECT Count(DISTINCT num) FROM tmp_table;) WHERE a.seq_type LIKE 'ABC% ';
the result of updating should be = a.currentvalue + 1 + 13
How is that possible? There is syntax error...
Not sure if this was clear ;-), but there's a semicolon behind tmp_table and SQL does not understand that.
Then
UPDATE seq_table SET a.currentvalue = a.currentvalue + 1 + (SELECT Count(DISTINCT num) FROM tmp_table) WHERE a.seq_type LIKE 'ABC% ';
Tags: Database
Similar Questions
-
How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?
I have the simple mxml code
<mx:DataGrid id="DGG"
editable="true">
<mx:dataProvider>
<mx:Object scheduledDate="4/1/2006"/>
</mx:dataProvider>
</mx:DataGrid>
<mx:Button id="SetBut"
label="Set Array as Data Provider"
click="SetDP(); AddBut.visible = true;"
x="100.5"
y="164"
width="211"/>
<mx:Button id="AddBut"
label="Add a column!"
click="AddCol();"
x="100.5"
y="194"
width="211"
visible="false"/>
<mx:Script>
<![CDATA[
import mx.controls.dataGridClasses.DataGridColumn;
import mx.collections.ArrayCollection;
[Bindable]
public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);
public function SetDP():void
{
DGG.dataProvider=MyAC
}
public function AddCol():void
{
MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
DGG.columns.push(new DataGridColumn("Umpire"));
}
]]>
</mx:Script>I want to add lines to my datagrid table how do such thing?
How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?
(You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)
Change this:
public void SetDP (): void
{
DGG.dataProvider = MyAC
MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
}
public void AddCol (): void
{
var dgc:DataGridColumn = new DataGridColumn ("Umpire");
var ca:Array = DGG.columns;
CA.push (DGC);
DGG.columns = ca;
}Dany
-
How to use the T distribution table in sql statements?
Hi all
I'm in the need to use the T distribution table in sql... I don't know how to use...
Is there a function to use the values of table in sql statements?
Can someone please help me in this?How about this http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions157.htm#i1279931?
Concerning
Etbin
-
How to add the column to the compressed table
Hi gurus,
Can someone help me how to add a column to compressed tables
Thanks in advanceThe only difference is if added column has a default value. In this case:
SQL> create table tbl(id number,val varchar2(10)) 2 / Table created. SQL> insert into tbl 2 select level,lpad('X',10,'X') 3 from dual 4 connect by level <= 100000 5 / 100000 rows created. SQL> select bytes 2 from user_segments 3 where segment_name = 'TBL' 4 / BYTES ---------- 3145728 SQL> alter table tbl move compress 2 / Table altered. SQL> select bytes 2 from user_segments 3 where segment_name = 'TBL' 4 / BYTES ---------- 2097152 SQL> alter table tbl add name varchar2(5) default 'NONE' 2 / alter table tbl add name varchar2(5) default 'NONE' * ERROR at line 1: ORA-39726: unsupported add/drop column operation on compressed tables SQL> alter table tbl add name varchar2(5) 2 / Table altered. SQL> update tbl set name = 'NONE' 2 / 100000 rows updated. SQL> commit 2 / Commit complete. SQL> select bytes 2 from user_segments 3 where segment_name = 'TBL' 4 / BYTES ---------- 7340032 SQL> select compression from user_tables where table_name = 'TBL' 2 / COMPRESS -------- ENABLED SQL> alter table tbl move compress 2 / Table altered. SQL> select bytes 2 from user_segments 3 where segment_name = 'TBL' 4 / BYTES ---------- 2097152 SQL>
SY.
-
Hello
I use ascii_diadem_9.1_or_later.zip to merge the data from several .csv files.
The problem is that I am so some weird futuristic timestamps in a channel
which do not appear in the original .csv files:
How to adjust the VB Script automatically adds a new channel to the a .csv resulting
file with the original name of the .csv file for debugging purposes?
Any help is greatly appreciated!
Thanks, Katharina
Hi Katharina,
What happens when you drag your tiara BROWSER or Windows Explorer data files in the data portal? See all date/time values in a table in VIEW of this channel? The problem may be that you do not have a use but which properly load your data files. The example is designed to show you how to concatenate several files of data together, but assumes that you could provide / have your own use. If you use work already, then look for these lines to the top of the VBScript and substituting the name of your use "CSV". If your files have a file extension different "*.csv", then you must also change the line "FileExt '.
FileExt = ' CSV files, *.» CSV » ' « *. DAT; *. CSV '.
Use = "CSV" ' "' or 'SpecificDataPluginName '.Brad Turpin
Tiara Product Support Engineer
National Instruments
-
How to add the column to the table of QSqlDatabase if does not exist
Hello
I have an app World and want to update to include more features.
To do this I need to add more columns in an existing database table created using QSqlDatabase, someone knows how to do this please?
Tim
Hi, you can use ALTER TABLE
-
How to find the redo generated by each SQL statement?
Database version is 10.2.0.4. OS is AIX.
We must again excessive generation during a specific time. We want to identify what a statement contributes to excessive recovery.
ADDM shows this as a first observation
Waiting on event "log file sync" during the execution of operations of COMMIT and ROLLBACK consumed at the time of the important data.
Is it possible to know which statement sql generates how many redo in bytes for a moment?
Thank you
DelphineIs it possible to know which statement sql generates how many redo in bytes for a moment?
It will not help you.
For example, you can see a lot of UPDATE, DELETE, INSERT from the apps statements. Then? What you do with them? If you can modify the application to eliminate the useless LMD - it would be great of course. But it is unlikely.When the DML statements also generate Redo, does not cause them too much expectations "log file sync", because the writer log buffer empty buffer as soon as it fulfills more than 30% after a certain time or on Commit / Rollback.
Waiting on event "log file sync" during the execution of operations of COMMIT and ROLLBACK consumed at the time of the important data.
Right. This is because the writer written newspaper here synchronous, reliable, he waits until the HDD writes data down and meets its written OK.
And hard drives are not the fastest things in the computer. They are mechanical - that's why.I would recommend:
1. place files redo log on quick drives used preference dedicated only to this end. If other I/O will often disturb these readers resulting securities heads change causing longer HDD expected.
2 consider using faster technology such as SAN or SSD. -
How to add the new column in existing table to our desired location?
How to add the new column in existing table to our desired location?
For example, I have to add the new column 'course' before the salary column in the emp table.
I think the best way is to add the column at the end of the table and create a new view with the order of the columns...
Another option...
places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table
Refer
Add column (from table) in the desired position
Example:
CREATE TABLE temp_my_user LIKE)
SELECT * FROM password);
DROP TABLE password;
(Password) CREATE TABLE
userID NUMBER
, first name VARCAHR2 (25)
, middleInitial VARCHAR2 (1)
(, name VARCHAR2 (25));
INSERT INTO password (userID, firstName, lastName)
(SELECT username
first name
lastName
OF temp_my_user);
DROP TABLE temp_user;
-
How to add the new column to a specific position
Hello
My table looks like Fallows.
Select * from company
PRODUCT_ID COMPANY_ID COMPANY_SHORT_NAME COMPANY_LONG_NAME 1 1001 An Inc. Long name A Inc. 1 1002 B Inc. Long name B Inc. 1 1003 C Inc. Long name C Inc. 2 1004 D Inc. Long name D Inc. 2 1005 E Inc. Long name E Inc. 2 1006 F Inc. Long name F Inc. My requirement is I would LIKE to add A NEW COLUMN AS COMPANY_LOCATION NEXT TO COMPANY_SHORT_NAME
How to get there.
I tried like Fallows alter company table add company_location varchar2 (100) after company_short_name;
but this query shows the error
ORA-01735: invalid option of ALTER TABLE
If the query I've tried is correct?
Give me your suggestions.
Thanks in advance.
As long as you're on 11 GR 2 or lower, it will not work.
There is no Clause "AFTER"in the alter table do not add column."
You have the chance to use dbms_redefinition (when no interruption of service is possible) or manually create a new table with the columns in the order you need and then migrate the data and then drop the original and rename a new.
In case you are already on 12 c, you have a chance to add the column to the end and then make visible columns and invisible status in the right order. This way your column will get to the position that you want it to be.
Kind regards
Carsten
-
How to add the new column in the tabular layout editor in Oracle Forms
Hello
I need to add the new column to a datablock and display the newly added column in the form. What are the steps I need to follow.
1. I chose the new column from the view to the datablock.
2. Add the text element in the layout editor. But this position is not correct. It overlaps with another column. How to add the new column to the layout editor?
Thank you
HCIn the layout editor, you can simply drag the fields so that they do not overlap.
See http://www.youtube.com/watch?v=7emNa7THMLgSandeep Gandhi
-
Can I add the column to the playlist to my music list in itunes?
I consult my entire list of music, and I'd like to know what category of playlist I created that the song is in. Can I add the column to the playlist to my music list?
I use an older iTunes. You cannot create a column for playlists, but you can right click on individual tracks and is one of the elements to display the items in the lists of reading in which it is contained.
-
How to add the name of the title of graph in Excel
Dear friends
I'm using LabVIEW 8.0.I need how to add the name of the title of graph in Excel.
You have the report generation tool? If so, the VI of graph Easy Excel has an entry for this.
If you don't have the Toolbox, then you need to use ActiveX. Please do a search on the use of the ActiveX (there are examples provided with LabVIEW) to control Excel. Also, there are many examples in the thread Excel. NOTE: DON'T POST QUESTIONS IN THIS THREAD.
In the end, you will need to search for information contained in MSDN.
-
How to add the full value of two buttons?
How to add the full value of two buttons (any key) VI and display it in the output text box? I am attaching a sample program, but I know that his evil... Help, please
Try this
-
How to add the quick launch of the desktop icon bar
How to add the toolbar launch quick icon on the desktop. I can't find a desktop icon that will drag on
The following Microsoft KB article
http://support.Microsoft.com/kb/190355/en-us
will help you.
Good bye.
-
How to add the translation application to my email add FB?
Original title: translation
I need to know how to ADD the TRANSLATION software to my email add FB? Any help?
Try here: https://www.facebook.com/help/100117036792266
Translate the updated Facebook application on the road
Maybe you are looking for
-
Windows 10 won't install after formatting in the installer from the disc
Hello I tried to install 10 Windows on my MacBook pro 13 ' 2012 with SSD and HDD 10.11.5 running. I followed the procedure step by step with the Bootcamp Assistant for two hard drive. I have my USB Windows 10 install prepared, latest updates of Bootc
-
How to reset BIOS Satellite L30 - 11 d
Try to repair the laptop of pals and the need to get into the bios, he forgot the password someone help with the location of the cmos reset jumper? Thank you
-
Get the 1097 error when trying to call a Labview DLL
I had to write a wrapper DLL to use some functions in the DLL to a third party, and I'm having a few problems. I created an executable to test my code and it works fine, but when I try to execute the same function in the DLL that I created in Labview
-
HP Pavilion 15 - ac 179tx: update the BIOS
the BIOS update software is downloaded successfully. The installation starts but never ends. I left the facility to operate more than 3 hours and never finished. I had to stop/cancel the installation attempt. -Why not install? What should I do? Sh
-
I get the windows update error code 643. can someone help me?
I get a windows update, but then he says code error 643, don't know what to some may help me. Abrupt, thank you