How to write a select statement in which the condition?
Hello Frs,Need help in the development of a discoverer report.
My requirement is to write a query similar to this one
Select * from emp is dept_no not in (select Department dept_no where emp_name like ' a % ;))
Help, please.
Thank you
Rajesh
Hello
to do this exactly how you can do 1 of 3 things:
1 use the Discoverer Desktop edition (most didn't do it) and use the sub query option you will find in the conditions.
2. create a custom in the BA folder and create the report on the new custom folder
3. create a view of db that contain your selection, and then create a folder in the BA based on this point of view and then create your report.
Tamir
Tags: Business Intelligence
Similar Questions
-
How to write a select statement inside the case operator
Hi all
I want to write a query that get the result of another table of case operator.
for example
Select a, b, c of the double
where a = 1
and b = case when b is null then 'select any value from the other table' any other purpose;
Please help me to write this query.
Thank youSelect a, b, c of the double
where a = 1
and b = case when b is null then 'select any value from the other table' any other purpose;Guilty plea
Select a, b, c from tableA a
where a.a = 1
and a.b = (select decode (a.b, null, (select 1 from tableB b where rownum = 1), a.b) double) -
How to block a select statement for a table of the specified until validation line
Hello
How to block a SELECT statement for a specified row in a table until willingness to engage occure?
My procedure is part of a Stock request and if a user (X) get stock 1 piece, another user must wait for the user (Y) complete his reportoire.
So, let say my stock have 10 pencils.
When the X user starts the Stock_PLS procedure, in table Stock, line (e.g. R1) that user X should work with it, must be lock up to what the commit / rollback will appear.
procedure Stock_PLS...
Start
..
pencils: pencils-1 =;
..
End
Observation-> pencils: = 9;
This means that is a user there, run SELECT * stock of the table where rows_id = R1, SELECTION should wait the Stock_PLS started by user X will be completed (with commit or rollback) and his SELECT should return the value 9.
What I need, is that Oracle has something like LINE EXCLUSIVE TABLE LOCK, but in my situation the SELECT statement should be denied on the specified lines, until the end of the procedure.
Kind regards
MichaelHello
You can achieve this using the update with the Select clause.
You can write your select statement like this
SELECT * from stock of the table where rows_id = R1 for update; -
How to get a select statement to pass a variable as the OUT parameter in PROC
I have the underside of the nested select statement that returns the name of the missing table (data_table_name).
How to be an effective way to modify the select statement, so that the returned 'data_table_name' is passed as OUTPUT in a procedure parameter
Any help is greatly appreciated.select 'Missing Table Name : ' || data_table_name from ( select upper(data_table_name) data_table_name from TABLE1 where data_table_name in ('ABC',EFG','XYZ') MINUS ( select upper(fus_data_table_name) from TABLE2 where fus_data_table_name in ('EFG',') group by upper(fus_data_table_name) union select upper(fus_data_table_name) from TABLE2 where fus_data_table_name = 'LMN' group by upper(fus_data_table_name) ));
SCREATE OR REPLACE PROCEDURE myproc (tname OUT NOCOPY VARCHAR2) AUTHID CURRENT_USER IS BEGIN SELECT something INTO tname FROM whatever; EXCEPTION WHEN OTHERS THEN tname :=
; END myproc; / -
A select statement to get the current pay rate.
If someone can share with me a select statement to get the current salary?Try the PER_PAY_PROPOSALS table with the fields Pay_xxxx.
See if the following threads help
Query to find the salary of the employee details in HRMS
HR Payroll - how to calculate the average hourly rate for workersSandeep Gandhi
-
concatenation error - when I use the value of the column of text in which the condition.
Hello
I'm creating Materialized view using a few columns from two tables and by obligation, I need to prepare a select statement with a where condition in another column. (new heading)
I tried like below...
create a materialized view HAND
force refresh on demand
as
Select
a.table_name,
a.column_name,
b.trial_name,
' Select * from ' | '. a.table_name |' where ' | a.column_name | ' = '|| b.trial_name | « ; » "QUERY".
Of
exp_csv_tB has,
b exp_csv_tr;
the value of name a.table is: monitoring_table
a.column_name value is: study
b.trial_name = fty777
Materialized view created with an extra column, but it is not added "(codes) to the value of the text in which the condition.
output I got is:
Select * from monitoring_table where study = fty777;
but
I need output like
Select * from monitoring_table where to study = "fty777";
value of fty777 must be in the codes like "fty777". I read a few articles, but did not get this example.
Help, please.You need to escape your quotes (double upward on quote)
create materialized view MAIN refresh force on demand as select a.table_name, a.column_name, b.trial_name, 'select * from '||a.table_name||' where '||a.column_name|| ' = '''|| b.trial_name||''';' "QUERY" from exp_csv_tB a, exp_csv_tr b;
-
How to convert this select statement in the update
Hai All
I have two tables namely Daily_attend, Train_mast
The Daily_attend are made up of fields are Train_mast are made up of fields are
Name varchar form no var
Date of empcode Num V_DATE
Intimate Date Train_name var
Outtime date Late_hrs var
Number IND_IN
Number IDE_OUT
Date of Attend_date
I need to update the table Depend of IDE_IN in Daily_attend in late_hrs in the Train_mast table
I got through in the select statement, it is my select statement
Select to_number (TO_DATE (TO_CHAR(Intime,'DD-MON-YYYY') |)) » '||
To_char (0815, '0000'), 'MON-DD-YYYY HH24') + late_hrs /(24*60)-respondent
) * 24 * 60 dail_Att, train_mast;
How can I convert to update
Any help is highly appricateable
Thanks in advance
Concerning
Srikkanth.MSrikkanth,
Try this code. And 1 thing, I don't see any WHERE condition to join between the 2 tables, DAIL_ATT, TRAIN_MAST.
UPDATE DAIL_ATT A SET A.IDE_IN = (SELECT TO_NUMBER(TO_DATE(TO_CHAR(INTIME, 'DD-MON-YYYY')|| ' ' || TO_CHAR(0815, '0000'), 'DD-MON-YYYY HH24:MI') + LATE_HRS / (24 * 60) - INTIME) * 24 * 60 FROM TRAIN_MAST B WHERE
); Kind regards
Manu.
If my answer or the answer to another person has been useful or appropriate, please mark accordingly
-
How to INSERT a SELECT statement with a GROUP BY clause on a table with an IDENTITY column?
n an application, I intend to truncate and insertion on a 12 c Oracle database, but have found this problem with a
IDENTITY
column. Even if theINSERT... SELECT
statement works on mostSELECT
uses I tried, if this statement was also aGROUP BY
clause, it does not work, delivering a "ORA-00979: not aGROUP BY
expression ' complaint. Some examples of code:create table aux ( owner_name varchar2(20), pet varchar2(20) );
insert into aux values ('Scott', 'dog');
insert into aux values ('Mike', 'dog');
insert into aux values ('Mike', 'cat');
insert into aux values ('John', 'turtle');
create table T1 (
id number generated always as identity,
owner_name varchar2(20),
pet_count number );
select owner_name, count(*) as pet_count from aux group by owner_name; -- works just fine
insert into T1 (owner_name, pet_count) select owner_name, count(*) as pet_count from aux group by owner_name; -- doesn't work
The select statement works by itself, but it fails as an INSERT... SELECT statement.
Appreciate the help!
Looks like a bug. You must open the SR with Oracle. Meanwhile, you could materialize select:
SQL > insert into T1 (owner_name, pet_count)
2 with t as (select / * + materialize * / owner_name, count (*) as pet_count to the owner_name group)
3. Select owner_name, pet_count t
4.3 lines were created.
SQL > select * from t1;
ID OWNER_NAME PET_COUNT
---------- -------------------- ----------
1 John 1
Scott 2 1
3 Mike 2SQL >
Keep in mind index THAT MATERIALIZE is undocumented.
SY.
-
Hello
I'm trying to achieve the following objectives:
1. in table A, select rows based on the values in column 2. something like SELECT * FROM TABLE A WHERE (COLUMN2 = 'X' or Column2 IS NULL)
2 and these values selected, I want to update Column3 from Table A if TableA.column1 = TableB.column1, but only if there is exactly one game. If there are multiple matches, column 3 of the table article updated.
That's what I've tried so far.
UPDATE TABLE_A
SET
TABLE_A.COLUMN3 = (SELECT COLUMN3 OF TABLE_B
WHERE ((TABLE_B.COLUMN1 = TABLE_A.COLUMN1) AND ( TABLE_B.COLUMN1 IN (SELECT Column1 FROM TABLE_B GROUP BY COLUMN1 , HAVING COUNT (*) = 1)))
WHERE EXISTS (SELECT * FROM TABLE_A)
WHERE ((TABLE_A.COLUMN2 = 'X' OU TABLE_A.COLUMN2 = 'Y') AND (TABLE_A.COLUMN4 IS NULL OR TABLE_A.COLUMN4 = ' ')));
More details on my DB environment:
Version Info:
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
PL/SQL Release 11.2.0.4.0 - Production
Toad, but, depending on whether the query updated all lines. I would really appreciate if someone could tell me how to fix my request.
Thanks in advance.
Exists it predicate in the block of update will be set to true if there is at least one row in table_a where column2 is X or Y and column4 is null or a space. You need to correlate exists it with the outer query query (I'm guessing on column1) to get the result I think you want. However, who would update all rows in table_a who meets the criteria, there is a corresponding row in table_b, affecting Column3 lines form null not matched or not. (Again), I'm guessing that's not your intention. If you only want to update the lines in table_a which have a corresponding line in table_b and meet the other predicate, then I think you want something more like:
Update table_a
Set table_a.column3 = (select column3 of table_b
where table_b.column1 = table_a.column1 and
Table_B.Column1 in (select column1 from table_b
Group by column1, having count (*) = 1))
where ((table_a.column2 = 'X' ou))
table_a.Column2 = 'Y') and
(table_a.column4 is null or)
table_a.column4 = ' ')) and
table_a.Column1 in (select column1 from table_b
Group by column1, having count (*) = 1)
John
-
How to write a single line instead of the entire port?
Hello
I followed the example for writing to the digital line as follows
int taskHandle;
given int [8];
char linename [] = "" dev2/port0 / line0:7 ";"
DAQmxErrChk (DAQmxCreateTask ("", & taskHandle));
DAQmxErrChk (DAQmxCreateDOChan (taskHandle, linename, "", DAQmx_Val_ChanPerLine));
DAQmxErrChk (DAQmxStartTask (taskHandle));
DAQmxErrChk (DAQmxWriteDigitalU8 (taskHandle, 1, 1, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL)); Here the data have 8 digits
Error:
SetWaitCursor (0);
If (DAQmxFailed (error)) DAQmxGetExtendedErrorInfo (errBuff, 2048);
If (taskHandle! = 0)
{
DAQmxStopTask (taskHandle);
DAQmxClearTask (taskHandle);
}
If (DAQmxFailed (error)) MessagePopup("DAQmx Error", errBuff);The example above shows how to write 8 binary to 8 lines, but how to write only one line? I try the following code, but it does not work
char linename [] = "dev2/port0/line 2;
...
DAQmxErrChk (DAQmxWriteDigitalU8 (taskHandle, 1, 1, 10.0, DAQmx_Val_GroupByChannel, & data [2], NULL, NULL)); Here the data have 8 digits
The data format for the DAQmxWriteDigitalLines() function will do exactly what you want.
The data format for the DAQmxWriteDigitalU8() function is a full port (even if you do not have a value of a harbour full of lines in your task).
-
How to write a script to report to the page number in a book?
Hello
Is it possible to write a script to report to the page number in a book by pop up a text file.
What I'm trying to say:
first of all, I opened an indesign book, thenI run the script, the script can gen a text pop-up file and the list of files, the file names and page numbers (only the star number of each file) and the script can also tells me that I have two files or more overlap page numbers (if any).
sample:
report like this:
01 table of contents 1
02 2 Summary
03 the financial of the 3 games
Statement by the President 4 04
05 MD and A 7
06 12 CG report
Report of the directors 07 17
08 18 auditor's report
Profit and loss account 09 19
profit and loss 20 10
11 equity change 20
Cash 12 21
13 notes on the 22 account
14 42 corporate informationFile have the page number of overlap:
profit and loss 20 10
11 equity change 20Thank you
Is that what you need?
var book = app.activeBook, _content = []; overlap = []; for(var i =book.bookContents.length-1;i>=0;i--) { _content.push(book.bookContents[i].name + "\t" + (book.bookContents[i].documentPageRange.replace(/-[^-]+$/g,"")) + "\r"); if(book.bookContents[i].documentPageRange == book.bookContents[i-1].documentPageRange) { overlap.push(book.bookContents[i].name + "\t" +book.bookContents[i].documentPageRange + "\r" + book.bookContents[i-1].name + "\t" +book.bookContents[i-1].documentPageRange); } } alert(_content.reverse()); alert(overlap.reverse())
Kind regards
Cognet
-
I'm fairly new to Illustrator, but it seems like it should be simple. (It's trivial in CorelDraw X 4: after selecting an object with three knots, I go to Edition > search and replace > find objects > find objects that correspond to the currently selected object and navigate the menus left.)
In Illustrator CS5, select options > identical do not seem to include the selection of all objects with the same number of nodes under the currently selected object.
A double click on the magic wand tool also does not provide such an option.
Thanks for any help.
PS also useful would be knowing how to add other criteria to this search, for example, how to select all objects with three points * and * the current fill color.
advictoriam,
I'm afraid that you have better luck with the number of anchor Point.
-
How to write express line and column of the tables headers to a file
HI guys, I work with that express table and display data using the express table. What I want to do, is that when I press save button results data in the specific table must be written to a text file. I am able to write the text file, but only the data is written. Y at - there a possiblity that I can also write lines and column headers and the data in the text file. Kindly guide me in this regard as soon as possible. I enclose the image also. Please watch this and guide me.
Cordially Ehtisham Safdar.
Hello
Sorry for the late reply. Here is the VI, I hope it works for you. Rather than each element of the index and the addition of the row header, take advantage of the available icons and play with the nodes of property for a good solution.
Concerning
Gaze
-
How oracle write "Checkpoint is not complete" in the journal of alerts?
DB version: 10.2.0.4/RHEL 5.8
In a batch run, we met a lot of 'Checkpoint not finish' errors in the alerts log.
Later we discovered that the ORLs were only 50 MB in size and that DB had only 3 redo log group. Since this is the likely reason, we will create at least 10 groups of Redo log and increase the size of Redo log at 500 MB.
But I want to know what exactly are the causes oracle to write "Checkpoint is not complete" in the journal of alerts?
For the purpose of this discussion, I guess we have only 1 ENT by redo log group. Is my assumption correct below?
ORL1
|--> ORL1 file got full, then LGWR begins writing to the file ORL2. Control point occurs at the command of journal
| DBWR writes updated the blocks associated with the entries of data files again ORL1
|
V
ORL2
|-> ORL2 file obtained full, LGWR wants to start writing to the file ORL3. Checkpoint is initiated to the log command.
| But the control point cannot be completed for reasons unknown
|
V
ORL3
|---------------->
Your assumption is only partially right.
I like to illustrate
ORL1
|
|---> ORL1, file got full, then LGWR begins writing to the file ORL2. Control point occurs at the command of journal
| DBWR begins writing modified blocks associated with the entries of data files again ORL1
|
V
ORL2
|---> ORL2 file obtained full, LGWR begins writing to the file ORL3.
| Checkpoint for ORL2 is initiated to the log command.
|
V
ORL3
|
|---> ORL3 queue (the last member) also got full very quickly. LGWR wants first of all the 'new round '.
writing (re-use) to ORL1. But the outlined point of control of the previous cycle ORL1 journal is
not finished yet! .
Basically, you get this error when LGWR tries to reuse a log file of roll forward online (ORL1 in the example above) and considers that it cannot be.
This is because the remaining files (ORL2 and ORL3) ORL got entirely written before DB writer finished modified checkpointing associated blocks ORL1 again.
Until the ORL1 control point is completed, DB crashes effectively and user sessions must wait until LGWR can reuse safely ORL1
Yes can help a larger size of log roll forward to 10 groups. , But make sure that the input/output subsytem where are stored the ORLs has no latency problem.
-
We can use EXISTS in which the condition
Hi all
We can use EXISTS (instead of IN) in which the status of a query that is not part of a subquery?
for example:
Update gpf_vou_sm set up_amt = 0 where src_cd ('1101 ', ' 1201');
the application works very well with the IN instead of EXISTS operator.
Everyone please help.
Thomas k prakashUsing in your case is better...
Yu S.Nayef are right IN suits here because the values are known
Maybe you are looking for
-
Messages are sent from my computer that I am not author
I get several e-mails saying that messages could not be delivered to one or more of its recipients. I have not started these emails. How can I stop anyone who has hi-jacked my computer to send these messages to do this?
-
I have several hundred bookmarks in mozilla. Now, I would like to save in the file/folder. How can I make 15 or if the folders/files to my favorites?
-
HP Officejet 4500 g510-m, it scans, but it does not print
Hello I have a HP Officejet 4500 g510-m, which seems to work fine. When I connect it to my laptop, which is a Sony VAIO with windows 7 64 bit, using a usb cable it scans normally but it does not print. There is no error push up, even in the print que
-
Java.io.FileNotFoundException 12 c - OMA Silent Installation on Windows - OEM method
Hi allI will install the Oracle Management Agent in Windows 2008 64-bit environment to start to monitor this host. The server has no anti-virus running and no firewall turned on. First of all, I run the Setup in quiet mode by using the parameter - pr
-
I downloaded photoshop on my laptop are the tiny icons How can I normal size?
I downloaded photoshop on my laptop are icons tiny someone knows how to get to normal size?