Getting the output of two different sqls in analysis
Hi,
Please consider the scenario:
I have to get the division value of two diffrent sqls in my analysis. The sqls will look like:
1st SQL: SELECT DISTINCT <alias name1>.<col1>
,<alias name1>.<col2>,<alias name1>.<col3>,<alias name1>.<col4>
FROM Table1 <alias name1>, Table2 <alias name2>, Table 3<alias name3>
WHERE
<alias name3>.<col2>= <alias name2>.<col2> // joining condition
AND <alias name3>.<col3>= <alias name1>.<col1> // joining condition
AND <alias name2>.<col1>= 'value1'
AND <alias name2>.<col4>= 'value2'
2nd sql: SELECT DISTINCT <alias name1>.<col1> FROM Table1 <alias name1>
WHERE <alias name1>.<col4>= 'value2'
The 1st sql has joining between 3 tables. and the 2nd SQL has no joining. whenever I drag and drop the columns with respect to the two sqls separately. it gives correct output. But it does not give me correct output when i try to do it together as all the tables are joined.
The sql which works as 2nd sql is:
SELECT DISTINCT <alias name1>.<col1>
FROM Table1 <alias name1>, Table2 <alias name2>, Table 3<alias name3>
WHERE
<alias name3>.<col2>= <alias name2>.<col2> // joining condition
AND <alias name3>.<col3>= <alias name1>.<col1> // joining condition
AND <alias name2>.<col4>= 'value2'
I need my 2nd sql to give me output without the join conditions of 1st sqls. how can I achieve this?
Please help. I need it urgently.
Thanks in advance..
hi,
I have tried by creating a separate alias for table1. But that is not working. alias is giving me joined output..
Can you suggest me any other way to do it?
Thanks
Similar Messages
-
Get the difference between two java.sql.Time values
Hi, I'm developping a web application in which I need to to subtract one java.sql,Time value from another. The two values are stored in a database field of type DateTime. I used following code
java.sql.Time start_time=resultset.getTime("startTime");
java.sql.Time end_time=resultset.getTime("startTime");
java.sql.Time diff=start_time-end_time;
can u give me any comment on this codeRemember what the Date/Time object in Java represents - a single point in time.
Subtracting one from another gives you an amount of time elapsed between the two dates. Fine.
Making a new Date out of that number is incorrect. The number no longer represents a point in time, but rather a duration.
Its like saying "There is 10 seconds difference between the two times, so the time is now 1 Jan 1970, 00:00:10 GMT".
The simple and stupid calculation is to take the milliseconds difference, and divide it to get to a more humanly readable value.
// duration in milliseconds
long duration = ?????
long durationInSeconds = duration / 1000;
long durationInMinutes = duration / (60 * 1000);
long durationInHours = duration / (60 * 60 * 1000);
// careful - not always true!
long durationInDays = duration / (24 * 60 * 60 * 1000);
NOTE: The "daysBetween" calculation is potentially complicated by Daylight Time adjustments. The simple approach does not necessarily work exactly.
Cheers,
evnafets -
How to get the difference of two dates in years,months and days
Hi friends,
how to get the difference of two dates in years,months and days
for ex 2 years 3 months 13 days
select (sysdate-date_Start) from per_periods_of_service
thanksSomething like this...
SQL> ed
Wrote file afiedt.buf
1 with t as (select to_date('17-nov-2006','dd-mon-yyyy') as c_start_date, to_date('21-jan-2008','dd-mon-yyyy') as c_end_date from dual union all
2 select to_date('21-nov-2006','dd-mon-yyyy'), to_date('17-feb-2008','dd-mon-yyyy') from dual union all
3 select to_date('21-jun-2006','dd-mon-yyyy'), to_date('17-jul-2008','dd-mon-yyyy') from dual
4 )
5 -- end of test data
6 select c_start_date, c_end_date
7 ,trunc(months_between(c_end_date, c_start_date) / 12) as yrs
8 ,trunc(mod(months_between(c_end_date, c_start_date), 12)) as mnths
9 ,trunc(c_end_date - add_months(c_start_date, trunc(months_between(c_end_date, c_start_date)))) as dys
10* from t
SQL> /
C_START_D C_END_DAT YRS MNTHS DYS
17-NOV-06 21-JAN-08 1 2 4
21-NOV-06 17-FEB-08 1 2 27
21-JUN-06 17-JUL-08 2 0 26
SQL>But, don't forget that different months have different numbers of days, and leap years can effect it too. -
How can I get the output of graphical mapping as an input to java mapping?
Hi Experts,
I am using graphical mapping in my scenario to get an xml at the end, now after this i want to use java mapping and then do encryption on this input. I am using both the mappings in the same interface
Here the thing is, the input to the java mapping should be the output of the first graphical mapping.
How can I link the java mapping and graphical mapping so that Ill get the output of the graphical mapping as the input to the java mapping?
Some pointers to similar kind of implementations is highly appreciated.
Thanks in advance,
Thomas
Edited by: Thomas Varghese on Jan 22, 2009 11:35 AMhi,
the input to the jave mapping will be exaclty the same as if you don't have
any mapping before that
the only different is that the input will be XML of the output of the message mapping
have a look at my blog to see how to combine two mappings:
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
that's all
Regards,
Michal Krawczyk -
Are You All Able to get the Output In EXCEL Format
Hi All,
I have one question. Are You All Able to get the Output In EXCEL Format?? I am working on Oracle Apllication 11.5.10.2 and my XML builder is 5.0.1. Problem which i m facing is this...... Whenever i am submitting a concurrent program with format type different from PDF i could not able to view the ouput in desired format. When i am pressing view output it gives me a file in XML and when i save that file with extention 'xls' or 'rtf' then i could able to see the saved file in desired format.
Can anyone tell me where is the problem??? Is it a bug?
I am using microsoft world 2000 sp-3.
Please give your valuable comments. May be your comments can solve my problem..
Thanks
RaviHi I got Same issue
When I change Format to EXCEL from
Submit request>> Option>> Format = EXCEL
In window I am getting something HTML code and
when I try to copy it to Browser from Tools>> Copy File in to Browser I am getting following message
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
End tag 'p' does not match the start tag 'a'. Error processing resource 'http://our url.com:8000/OA_CGI...
<p class="c0"><a name="Text4" id="Text4"><a name="Text1_1" id="Text1_1"><span class="c1">Dept No <...
But I can see the output when Format is PDF
Pls suggest solution ,I am using EBS 11.5.10.2.
Thanks
Rahul
Message was edited by: Rahul
user576181 -
How to get the output of a procedure in to a log file ?
Hi, Everyone,
Could you please tell me
How do i write the output of a procedure to a log file ?
Thanks in advance...Hi,
could you please explain me more on how to use the UTL_file to get the output to a log file as in am new to PL/SQL
my script file is
EXEC pac_sav_cat_rfv.pro_cardbase (200910,'aaa',100,'test_tbl');
i need the output of this statement in a log file.
Could you please explain to me how it can be done.
thanks in advance -
NOOB Question - Cannot seem to get the output in a text or CSV file - Please help!!
I was able to put together a script which finds members of a certain AD group, filters down the users, and then calculates the number of days till a password reset is needed. I am able to get on screen exactly what i am looking for, but cannot seem
to figure out how to get the same data to a file. What i am doing wrong? two goals here:
1. Create a spreadsheet with a list of users whose password is about to expire.
2. Down the line automate an email to users whose password is about to expire.
Here is my code:
## Get List Of Users in Password Change Lockout that do not have an expired password or a password that never expires
$Names = (Get-ADGroupMember -Identity "Password Change Lockout" -Recursive |`
Get-ADUser -Properties * |`
Where-Object {$_.PasswordNeverExpires -eq $False -and $_.PasswordExpired -eq $False} |`
Sort-Object name |Select-Object -ExpandProperty SamAccountName)
## Get Password last Set values for all
Foreach ($Name in $Names)
$VAR1 = (Get-ADUserResultantPasswordPolicy -Identity $Name).MaxPasswordAge
$VAR2 = (Get-ADUser $Name -Properties *).passwordlastset
$VAR3 = (Get-ADUser $Name -Properties *).name
$DTPC = (New-TimeSpan -Start (Get-Date) -End ($VAR2 + $VAR1) | Select-Object -ExpandProperty Days)
Filter users to those who need to change thier password in 15 days.
If ($DTPC -lt 15)
No matter what i try between the {} after the If statement, I cannot get the output to a file. However, if I use a Write-Output I get exactly what i looking for. I feel like i am forgetting some basic concept and could really use some help. Thanks.
Matt
Matt DillonHi Matt,
I generally create an empty array (something like $out = @()) at the top of the script and then use $out += $desiredOutput inside of the foreach loop.
Outside of the loop, you can then pipe $out to Out-File or Export-Csv, depending on your needs.
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
To get the output in the chart for a single selection
Hi all,
I used a query to get the output of the table, and for the same query i have created a view to get the result in the chart.
to get the output of the table for a particular region i have created an input field and added value help to it. When i selected one particular region, i will be getting the data, in the table. But when i select a particular row in the table i need to get the data of that particular row only in the chart. (which i am getting)
But when i select multiple regions at a time, then i am facing the issue. I get result of multiple regions data(at a time two rows are displayed in the chart) in the chart. where in i want to get data only for one region (only one row needs to get selected at a time) to get the result.
Can any one throw a light of what needs to be done here.
Thanks,
RaniHi Rani,
I am not sure if I understand your question exactly, but it sounds like you need to set the selection mode for your table to "Single". If you do that the user will only have the possibility of selecting one row at a time in the table; they will not be able to select multiple rows.
You make that setting in the Configure Element panel for the table.
I hope this suggestions helps.
Margaret -
How to get the output in ALV format
Hi All,
this is my program, in this i want to get the output in ALV, i hv created two containers and m able to get the ALV layout successfully but i am not able to fetch the correct data.
the output it is showing is some RFC value.
here we have used - abaplist, soli.
Please provide me the solution.
SELECT * FROM varid INTO CORRESPONDING FIELDS OF TABLE t_varid WHERE report in s_report.
LOOP AT t_varid .
SUBMIT (t_varid-report) USING SELECTION-SET t_varid-variant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listtab
EXCEPTIONS
not_found = 1
OTHERS = 2.
**************Old System Entry********
CALL FUNCTION 'Z_GET_DETAILS'
DESTINATION 'BWDCLNT900'
EXPORTING
report = t_varid-report
variant = t_varid-variant
TABLES
listtab = list_tab.
IF sy-subrc EQ 0.
CALL FUNCTION 'LIST_TO_TXT'
TABLES
listtxt = listtxt1
listobject = list_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2.
ENDIF.
if p_flag eq 'X'.
clear p_flag.
write : / 'Program Name',
41 'Variant Name',
66 'Output Match'.
endif.
IF listtxt EQ listtxt1.
WRITE : / t_varid-report,
41 t_varid-variant,
66 icon_green_light AS ICON HOTSPOT.
ELSE.
WRITE : / t_varid-report,
41 t_varid-variant,
66 icon_red_light AS ICON HOTSPOT.
ENDIF.
CLEAR : listtab,list_tab,listtxt,listtxt1.
REFRESH : listtab[],list_tab[],listtxt[],listtxt1[].
ENDLOOP.
AT line-selection.
v_report = sy-lisel(40).
v_variant = sy-lisel+40(14).
call SCREEN 400.
module STATUS_0400 output.
SUBMIT (v_report) USING SELECTION-SET v_variant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listtab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_TXT'
TABLES
listtxt = listtxt1
listobject = list_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2.
**************Old System Entry********
CALL FUNCTION 'Z_GET_DETAILS'
DESTINATION 'BWDCLNT900'
EXPORTING
report = v_report
variant = v_variant
TABLES
listtab = list_tab.
CREATE OBJECT CCONT1
EXPORTING
CONTAINER_NAME = 'C1'.
CREATE OBJECT CCONT2
EXPORTING
CONTAINER_NAME = 'C2'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = CCONT1.
CREATE OBJECT GRID2
EXPORTING
I_PARENT = CCONT2.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'abaplist'
CHANGING
IT_OUTTAB = list_tab.
CALL METHOD GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'abaplist'
CHANGING
IT_OUTTAB = listtab.
SET PF-STATUS 'ZUTDEMO2'.
endmodule.
module USER_COMMAND_0400 input.
IF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
endmodule. " USER_COMMAND_0400 INPUTsolved
-
In oracle Httpuritype - Not getting the output correctly
Hi, I am trying out httpuritype in oracle for the first time. My requirement is to get the input string and the from_language and to_language and has to be converted accordingly.
I am using oracle 11.2.0.1.
So had setup acl explicitly and started writing the below program.
create or replace procedure trans_new_prc1
(p_words in varchar2, -- words to be translated
p_to in varchar2 , -- language to translate to
p_from in varchar2 ) -- language to translate from
is
l_res varchar2(2000);
l_words varchar2(2000);
txt varchar2(2000);
begin
txt:=utl_url.escape(l_words);
l_words:=regexp_substr(httpuritype('http://translate.google.co.in/?hl=en&tab=wT#'||p_from||'/'||p_to|| txt).getclob(),'"(.*?)"',1,1,null,1);
Dbms_output.put_line( l_words);
end;
While converting from polish language to english language I get the output as
SQL> exec trans_new_prc1('hen','pl','en');
text/html; charset=ISO-8859-2
But i need the exact string in polish language, which i am not getting. Please guide me.
Even while converting it into chinese language, i get the following message
SQL> exec trans_new_prc1('hen','zh-CN','en');
text/html; charset=ISO-8859-2
Please guide me to get the output exactly in chinese language.I think the problem is, google translate is not giving that info with this URL ! I removed REGEXP_SUBSTR and get all html code from HTTPURITYPE, in returned code, there is no translated word info!
for the code
exec trans_new_prc1('hen','ENGLISH','AUTO');result is:
<!DOCTYPE html><html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><meta name=keywords content="translate, translations, translation, translator, machine translation, online translation"><meta name=description content="Google's free online language translation service instantly translates text and web pages. This translator supports: English, Afrikaans, Albanian, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Kannada, Korean, Latin, Latvian, Lithuanian, Macedonian, Malay, Maltese, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese, Welsh, Yiddish"><meta name=robots content=noodp><meta name=google content=notranslate><link rel="canonical" href="http://translate.google.com/"><title>Google Translate</title><link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml?hl=en" title="Google Translate"><script>function _gtErr(e){var i=new Image();i.src='/gen204?jserr='+encodeURIComponent(e+": "+e.stack).substr(0,2000);i.onload=function(){i.onload=null;};}window.onerror=_gtErr;</script><script>(function(){var ti_a=function(b){this.t={};this.tick=function(b,c,a){a=void 0!=a?a:(new Date).getTime();this.t=[a,c]};this.tick("start",null,b)},ti_b=new ti_a;window.jstiming={Timer:ti_a,load:ti_b};if(window.performance&&window.performance.timing){var ti_c=window.performance.timing,ti_d=window.jstiming.load,ti_e=ti_c.navigationStart,ti_f=ti_c.responseStart;0<ti_e&&ti_f>=ti_e&&(ti_d.tick("_wtsrt",void 0,ti_e),ti_d.tick("wtsrt_","_wtsrt",ti_f))}
there is no "THEM" (translated word) in it. (I couldnt write whole returned info because exceed post limits.) -
Smartform output in two different printers
Hi Experts,
I want to take the Smartform output in two different printers. printers has been added in the table <b>pkhd</b> .
please anyone suggest how to pass these two in the smartform function module?
Thanks in Advance
Kavya DevaHi Kavya,
You can execute the Smart form Function Module. It will then pop-up a dialog box asking for an output device. There you can specify the Output device type and go for Print or Print Preview as necessary.
Manoj -
Is it possible to show data from two different sql tables?
Is it possible to show data from two different sql tables? Either to show combined data by using a join on a foreign key or showing a typical master detail view?
I have one table With data about a house, and another table With URL's to images in the blob. Could these two be combined in the same Gallery?
Best regards Terje F - NorwayHi Terje,
If you have a unique key, you could use one of the following functions for your scenarios:
If you only have one image per house, you can use LookUp:
http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745501
If you have multiple images per house, you can use Filter:
http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745487
Thanks
Robin -
Can I get a query to get the output data like 4th column instead of 3rd col
Can I get a query to get the output data like 4th column instead of 3rd column ?
SQL> select emp.deptno, empno, rownum from emp, dept where emp.deptno=dept.deptno;
DEPTNO EMPNO ROWNUM
10 7782 *1* *1*
10 7839 *2* *2*
10 7934 *3* *3*
20 7369 *4* *1*
20 7876 *5* *2*
20 7902 *6* *3*
20 7788 *7* *4*
20 7566 *8* *5*
30 7499 *9* *1*
30 7698 *10* *2*
30 7654 *11* *3*
30 7900 *12* *4*
30 7844 *13* *5*
30 7521 *14* *6*
14 rows selected.SQL> select emp.deptno, emp.empno,
2 row_number() over(order by emp.deptno, emp.empno) rn,
3 row_number() over(partition by emp.deptno order by emp.empno) dept_rn
4 from emp, dept
5 where emp.deptno=dept.deptno
6 order by emp.deptno, emp.empno;
DEPTNO EMPNO RN DEPT_RN
10 7782 1 1
10 7839 2 2
10 7934 3 3
20 7369 4 1
20 7566 5 2
20 7788 6 3
20 7876 7 4
20 7902 8 5
30 7499 9 1
30 7521 10 2
30 7654 11 3
30 7698 12 4
30 7844 13 5
30 7900 14 6
14 rows selected.Regards,
Dima -
How to compare the contents of two different tables
hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
example, i have a table named Main List and a table named New List.
The contents of the New List should be compared to the contents of the
Main List, to check if they are equal. I don't have any idea how to manipulate
this data. Hoping for your help. Thanks.it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections
-
Unable to update or restore new iPad Mini 2. Get error 3014 on two different Macs.
Unable to update or restore new iPad Mini 2. Get error 3014 on two different Macs. This is a new out of the box iPad Mini 2. Am on a managed network, but have not had this problem previously.
First thing to do is make sure you have the latest version of iTunes on your computer.
This Apple support page will provide more information:
Error 3194, Error 17, or "This device isn't eligible for the requested build" - Apple Support
Maybe you are looking for
-
SOLAR_EVAL giving Incorrect report for Keywords
Hi all, We have implemented Solution Manager7.1 for our project during Realization phase. 1. I have added all the Managed systems to the Solution Manager. 2. Created the Project Structure in Solar01. 3. Added Config Nodes in Configuration Tab for all
-
Where can I find the serial number for Photoshop Elements 9?
Where do I find the ser# for my PSE9
-
Hello all, what I would like to ask is ... on my G5 ... can I install both FCP5 and FCP HD and use both?? Thanking you in advance!
-
i am making a contract with fields in DW CS3, how do i make fields calculate? example: I wish to purchase_____________gallons of heating oil at the fixed price of $_____________per gallon for a total cost of $ __________ where the total cost of "$
-
CISCO NAC deployment with ASA for internal servers (DMZ)
We have deployed cisco ASA for our clients access to DMZ servers few months ago. Now we want to integrate cisco NAC solution without removing ASA from infrastructure. What will be the best deployment mode of cisco NAC so that clients can also pass th