How to combine these two queries:
Select K.ID, K.DOWN_STATUS, K.UP_STATUS,(K.DOWN_STATUS+K.UP_STATUS) TOTfrom (select ID, SUM(CASE WHEN S_STATUS = 'DOWN' THEN 1 ELSE 0 END) DOWN_STATUS,
SUM (CASE WHEN S_STATUS = 'UP' THEN 1 ELSE 0 END) UP_STATUS
of test_info where CONNECT_TIMESTAMP BETWEEN ' 2012-03-27 00:00:00 ' AND ' 2012-03-27 23:59:59 '
Group by ID) k
Select r.ID,(r.DOWN_STATUS+r.UP_STATUS) TOTAL, (r.DEVICE_ID |) '|' || Str (r.UP_STATUS) | ' ~ ' || r.DEVICE_ID + ", ' | Str (r.DOWN_STATUS)) as deviceinfo
from (select ID, device_id, SUM(CASE WHEN S_STATUS = 'DOWN' THEN 1 ELSE 0 END) DOWN_STATUS,
SUM (CASE WHEN S_STATUS = 'UP' THEN 1 ELSE 0 END) UP_STATUS
of test_info where CONNECT_TIMESTAMP BETWEEN ' 2012-03-27 00:00:00 ' AND ' 2012-03-27 23:59:59 '
Group by ID, device_id) r
Maybe this?
select K.ID||'/'||K.DOWN_STATUS||'/'||K.UP_STATUS||'/'||(K.DOWN_STATUS+K.UP_STATUS) strout
from (select ID,SUM(CASE WHEN S_STATUS = 'DOWN' THEN 1 ELSE 0 END) DOWN_STATUS,
SUM(CASE WHEN S_STATUS = 'UP' THEN 1 ELSE 0 END) UP_STATUS
from test_info where CONNECT_TIMESTAMP BETWEEN '2012-03-27 00:00:00' AND '2012-03-27 23:59:59'
group by ID) k
union all
Select r.ID||'/'||(r.DOWN_STATUS+r.UP_STATUS)||'/'||(r.DEVICE_ID|| '|' ||STR(r.UP_STATUS)|| ' ~ ' ||r.DEVICE_ID+ ' , ' ||STR(r.DOWN_STATUS))
from (select ID,device_id ,SUM(CASE WHEN S_STATUS = 'DOWN' THEN 1 ELSE 0 END) DOWN_STATUS,
SUM(CASE WHEN S_STATUS = 'UP' THEN 1 ELSE 0 END) UP_STATUS
from test_info where CONNECT_TIMESTAMP BETWEEN '2012-03-27 00:00:00' AND '2012-03-27 23:59:59'
group by ID,device_id) r;
Tags: Database
Similar Questions
-
How to combine the two queries into a single
Hi gurus,
SQL > select * from v version $;
BANNER
----------------------------------------------------------------
Oracle Database 10g Release 10.2.0.4.0 - Production 64-bit
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for Linux: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL >
I have following two queries. How can I convert these two queries into one with the same result?
1ST QUARTER
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
WHERE processid = 32
AND venddate is null
AND vid to (select vid from view_vid where type = 'PDX')
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = 55)
AND (id, $vdate) in (select id, vidate from market_data where marketed_date is null)
AND id not in (select id from location)
Q2
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
WHERE processid = 20
AND venddate is null
AND vid to (select vid from view_vid where type = 'PBX')
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = 40)
AND (id, $vdate) in (select id, vidate from market_data where region_date is null)
AND id not in (select id from location)
I can the UNION queries these two, but is there some way I can write a single query that gives me the same result as above two queries?
Any help would be much appreciated
Thanks in advance
Sorry, it lack
SELECT id, $vdate, SupplierName, venddate, vid
THE SELLER
ProcessID WHERE in (32.20)
AND venddate is null
AND vid to (select vid from view_vid where type = case when processid = 32
then "PDX".
else "PBX".
end)
AND (id, $vdate) not in (select id, $vdate from vkfl_is where task_id = case when processid = 32
then 55
40 else
end)
AND (id, $vdate) in (select id, vidate from market_data cases where processid = 32)
then marketed_date
of other region_date
end to the null value
)
AND id not in (select id from location)
Concerning
Etbin
-
How to combine these two scripts
I have a script that displays the host name, the name of the data store and the NAAid in a csv file
$VMhosts = get-datacenter xxxxxxxx | Get-VMHost
$data = {foreach ($vmhost to $VMhosts)
$vmhost | Get-Datastore. Select @{N = "$vmhost"; E = {$vmhost. Name}},name,@{N="CanonicalNames '; E = {[string]: join (",",($_.ExtensionData.Info.Vmfs.Extent |)} %{$_. DiskName}))}}
Get-VMHost $vmhost | Get-ScsiLun - CanonicalName $naa
}
$data | Export-Csv "C:\report.csv" - NoTypeInformation - UseCulture
Then I have another script that if I put the ID NAA in a txt file it read and give me all the multitracks among other parameters
$naaids = get-content "c:\ctluns.txt".
{foreach ($naa to $naaids)
Get-Cluster ctclt | Get-VMHost | Get-ScsiLun - CanonicalName $naa | Export-Csv "c:\ctpaths.csv".
}
I want a script that gives me all the four elements in a csv file. Name of host, data store name, Id NAA and path. I am struggling with getting this works specfically feeding the NAA ID from a script in the script line two that pulls the info multichannel. Can anyone help?
If you want only the MultipathPolicy, you can remove the rest of the attributes.
Note: This script will take a large amount of time to run if you have to many data warehouses.
Here it is:
$VMhosts = Get-datacenter xxxxxxxxxx | Get-VMHost $output=@() foreach($vmhost in $VMhosts){ $datastores = $vmhost | Get-Datastore $paths =@() foreach($dt in $datastores){ $extentDatastore = $dt.ExtensionData.Info.Vmfs.Extent $extentDatastore| %{ $path = $vmhost |Get-ScsiLun -CanonicalName $_.DiskName $ConsoleDeviceName = $path.ConsoleDeviceName $LunType = $path.LunType $CapacityGB = $path.CapacityGB $MultipathPolicy = $path.MultipathPolicy $RuntimeName = $path.RuntimeName $Model = $path.Model $Vendor = $path.Vendor $tempOutput = ""| select VMHost,DatastoreName,CanonicalNames,ConsoleDeviceName,LunType,CapacityGB,MultipathPolicy,RuntimeName,Model,Vendor $tempOutput.VMHost = $vmhost.Name $tempOutput.DatastoreName = $dt.Name $tempOutput.CanonicalNames = $_.DiskName $tempOutput.ConsoleDeviceName = $ConsoleDeviceName $tempOutput.LunType = $LunType $tempOutput.CapacityGB = $CapacityGB $tempOutput.MultipathPolicy = $MultipathPolicy $tempOutput.RuntimeName = $RuntimeName $tempOutput.Model = $Model $tempOutput.Vendor = $Vendor $output+= $tempOutput }} } $output| Export-Csv "c:\ctpaths.csv" -NoTypeInformation -UseCulture
-
Want to combine the two queries
Hello
It is my first post here, I hope it's a good place to put it.
I have two queries that both gave me the results. I guess that both are way more elegant or better to do what they do, but that's what I came with. So feel free to modify them. However, my real problem is I want to combine these two queries in a single query, removing duplicate information.
analytical_query
SELECT * from( select requisitions.acc_id AS "Accession #" ,requisitions.draw_date AS "Draw Date" ,requisitions.received_date AS "Received Date" ,req_panels.run_date AS "Run Date" ,tests.TEST_ID ,(CASE WHEN tests.TEST_ID IN (7101) THEN results.RESULT_NUMERIC*2 ELSE results.RESULT_NUMERIC END) AS RESULT_NUMERIC ,doctors.f_name || ' '|| doctors.l_name AS "Physician" ,organizations.state AS "State" FROM requisitions inner join req_panels ON requisitions.acc_id = req_panels.acc_id inner join results ON req_panels.rp_id = results.rp_id inner join tests ON results.test_id = tests.test_id inner join doctors ON requisitions.doc_id1 = doctors.doc_id inner join organizations ON requisitions.org_id = organizations.org_id WHERE requisitions.DEL_FLAG='F' AND req_panels.DEL_FLAG='F' AND results.DEL_FLAG='F' AND req_panels.PANEL_ID IN (7000,70001,70551) AND results.TEST_ID IN (7101,7102,7107,7108) AND requisitions.RECEIVED_DATE > TO_DATE('9/1/2013', 'MM/DD/YYYY') ORDER BY requisitions.ACC_ID ) pivot( MAX(RESULT_NUMERIC) for TEST_ID IN ('7101' AS CRP,'7102' AS Hemoglobin,'7107' AS "LDT Run 1",'7108' AS "LDT RUN 2") )
culture_query
SELECT * from( select requisitions.acc_id AS "Accession #" ,MAX(requisitions.draw_date) AS "Draw Date" ,MAX(requisitions.received_date) AS "Received Date" ,MAX(req_panels.run_date) AS "Run Date" ,tests.TEST_ID ,LISTAGG(results.RESULT_ALPHA, ';') WITHIN GROUP (ORDER BY results.RESULT_ALPHA) RESULT_ALPHA FROM requisitions inner join req_panels ON requisitions.acc_id = req_panels.acc_id inner join results ON req_panels.rp_id = results.rp_id inner join tests ON results.test_id = tests.test_id inner join doctors ON requisitions.doc_id1 = doctors.doc_id inner join organizations ON requisitions.org_id = organizations.org_id WHERE req_panels.PANEL_ID IN (7000,70001,70551) AND results.TEST_ID IN (10010,10052,11010) AND requisitions.RECEIVED_DATE > TO_DATE('9/1/2013', 'MM/DD/YYYY') AND requisitions.DEL_FLAG = 'F' AND req_panels.DEL_FLAG = 'F' AND results.DEL_FLAG = 'F' AND req_panels.RUN_DATE is not null group by requisitions.ACC_ID, tests.TEST_ID ) pivot( MAX(RESULT_ALPHA) for TEST_ID IN ('10010' AS "Organism",'10052' AS "Negative/No Growth", '11010' AS "Growth") )
Basically, what is missing from the first query is the global list of the 'RESULT_ALPHA' for 'TEST_ID"10010, 10052 and 11010 numbers. And because of the way they want to view this information that I had to tilt it, which is where I ran into problems. If anyone has any idea on how I can combine these two requests and make them more effective that would be great.
Thank you.
Hello
JayG30 wrote:
... I have however found a way to do what I would call "swivel conditional." ...
I think it's the crux of this problem; you want MAX BOF a few tests and LISTAGG for others. I don't know a good way to attract the SELECT... PIVOT to do both at the same time. I think it's one of those situations where SOME... PIVOT is not the best tool for the job; MAX (CASE...) and LISTAGG (CASE...) may be more practical and more effective:
SELECT rq.acc_id
, MAX (rq.draw_date) AS "the draw Date.
, MAX (rq.received_date) as BEING "received Date".
, MAX (rp.run_date) AS "Date of the race.
, MAX (CASE WHEN rs.test_id = 7101 THEN rs.result_numeric * END 2) AS the crp
, MAX (CASE WHEN rs.test_id = 7102 THEN rs.result_numeric END) AS hemoglobin
, MAX (CASE WHEN rs.test_id = 7107 THEN rs.result_numeric END) AS "LDT Run 1.
, MAX (CASE WHEN rs.test_id = 7108 THEN rs.result_numeric END) AS "LDT, 2nd round.
, LISTAGG (CASE WHEN rs.test_id = 10010 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS "organization".
, LISTAGG (CASE WHEN rs.test_id = 11010 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS a 'growth '.
, LISTAGG (CASE WHEN rs.test_id = 10052 THEN rs.result_alpha END)
, ';'
) Within GROUP (ORDER BY rs.result_alpha) AS 'Negative/No growth '.
Rq requisitions
INNER JOIN req_panels ON rp.acc_id = rq.acc_id PR
INNER JOIN results rs ON rs.rp_id = rp.rp_id
WHERE rq.del_flag = 'F'
AND rp.del_flag = 'F'
AND rs.del_flag = 'F'
AND rp.run_date IS NOT NULL
GROUP BY rq.acc_id
ORDER BY rq.acc_id
;
I don't quite get the results you have posted; for example, I don't see how you get a row of results with 'Accession' = 142425, while acc_id does not occur in the sample data. It was maybe just a typo.
-
combine the two queries analysis
Hi friends,
could you please help me to combine these two queries. The bottom one looks like, take too many resources.
FUNCTION XML_error_log ()P_i_xml IN XMLTYPE, p_i_event_key IN VARCHAR2,( )
RETURN VARCHAR2
IS
l_covered_product_header_id NUMBER ;
l_item_path VARCHAR2 (500);
xml_table XMLTYPE;
p_ret_code_o VARCHAR2 (5);
p_error_buff_o VARCHAR2 (2000);
l_user_id NUMBER (15) := fnd_global . user_id ;
l_implicit_product_name VARCHAR2 (40);
l_top_model_line_id oe_order_lines_all . top_model_line_id % TYPE;
main_error_check VARCHAR2 (100) := NULL;
main_error_check1 VARCHAR2 (100) := NULL;
l_status_log_status VARCHAR2 (1);
l_err_msg_log_status VARCHAR2 (4000);
p_o_status VARCHAR2 (100);
p_o_err_msg VARCHAR2 (100);
P_i_input_res_xml XMLTYPE;
BEGIN
p_o_status := 'S' ;
p_o_err_msg := NULL;
Dbms_output.put_line ()' Start... process_response_xml ');
FOR i
IN (SELECT x. code , x . gravity , x . Description
DE XMLTABLE ( )
xmlnamespaces (DEFAULT ' urn: xyz:ccw:config:common: data'()
, ' for $i in //error
Returns the element r {}
$i / code,.
$i / description.
$i / gravity
}'
By the WAY P_i_input_res_xml
COLUMNS
code VARCHAR2 (13) Path 'code'
, gravity VARCHAR2 (30) Path "gravity"
, Description VARCHAR2 (30) Path 'description'
) x )
LOOP
DBMS_OUTPUT.put_line ) ( )
' code : ' || i . code );
DBMS_OUTPUT.put_line ) ( )
' severity: ' || i . gravity );
DBMS_OUTPUT.put_line ) ( )
' description: ' || i . Description );
main_error_check := i . code of : main_error_check;
INSERT IN xxgco_config_validate ()event_status ERROR_CODE error_description ,error_severity creation_date event_key last_update_date( )
VALUES('E',i. code , i . Description , i . gravity SYSDATE, p_i_event_key , SYSDATE);
RETURN 'E' ;
END LOOP;
DBMS_OUTPUT.put_line ()' main_error_check:' : main_error_check);
DBMS_OUTPUT.put_line ()' COMPLETED:');
IF main_error_check IS NULL
THEN
FOR i
IN (SELECT x. code , x . gravity , x . Description , x . subcause
DE XMLTABLE ( )
xmlnamespaces (DEFAULT ' urn: xyz:ccw:config:common: data'()
, ' for $i in //message
Returns the element r {}
$i / code,.
$i / description.
$i / gravity,.
$i / subCause
}'
By the WAY P_i_input_res_xml
COLUMNS
code VARCHAR2 (13) Path 'code'
, gravity VARCHAR2 (30) Path "gravity"
, Description VARCHAR2 (30) Path 'description'
, subCause VARCHAR2 (50) Path "subCause"
) x )
LOOP
DBMS_OUTPUT.put_line ) ( )
"code:" || i . code );
DBMS_OUTPUT.put_line ) ( )
' severity: ' || i . gravity );
DBMS_OUTPUT.put_line ) ( )
' description: ' || i . Description );
DBMS_OUTPUT.put_line()' subCause:': i. subCause );
INSERT IN xxgco_config_validate ()event_status ERROR_CODE error_description ,error_severity error_cause creation_date event_key last_update_date( )
VALUES('E',i. code , i . Description , i . gravity , i . subcause SYSDATE, p_i_event_key , SYSDATE);
main_error_check1 := i . code of : main_error_check1;
END LOOP;
IF main_error_check1 IS NOT NULL
THEN
RETURN ('E');
ON THE OTHER
RETURN ('S');
END IF;
ON THE OTHER
-TODO Log main error Log
RETURN ('E');
END IF;
EXCEPTION
WHEN Others
THEN
p_o_err_msg :=
SUBSTR (
' Error in the response_XML_error_log FUNCTION:'
|| SUBSTR (SQLERRM, 1, 250)
|| ':'
|| DBMS_UTILITY.format_error_backtrace ,
1 ,
4000 );
RETURN 'E' ;
END XML_error_log ;
Thanks in advance
Ok.. This isn't a constructive debate...
-
Paint or Windows Photo Gallery
I try to combine a picture of my sister with a picture of a poem beside it, how to combine the two into a single photo?
If you have the poem recorded in an image format,
the following freeware can create a side by side
Panorama.(FWIW... it's always a good idea to create a system)
Restore point before installing software or updates)Download IrfanView
http://MajorGeeks.com/IrfanView_d4253.html
(filename: iview433_setup.exe)
(uncheck if you don't want Google Chrome)Download plug-ins too...
IrfanView plugins
http://MajorGeeks.com/IrfanView_PlugIns_d4908.html
(filename: irfanview_plugins_433_setup.exe)When the program is installed... read more...
Open IrfanView and go... Image / create the Image of the Panorama...
(this will open the screen to "Create a panorama image")On the screen to "Create a panorama image"... left click on the add images"" button.
(Displays the 'Open' screen. Now, drill down to the
the folder that contains your saved Photos of veterinarians.Now... click left (highlighted), the two images, you want to join.
(you can select more than one if you hold down your Ctrl key)
The two images highlight... left click on the button 'open '.
(Or... you can add the images one at a time... which is always easier)Now, go back to the screen "Create the panorama image.
and the file names of the selected pictures need to be in the
Field "Input Images.Now with the names of two files in 'Images of entry' field...
You can left click on the button 'create Image '.(the positions left and right of these images can be swapped in)
selection of a file name and using the "mount image" / "Move."
Images down"buttons...)Now you should see a display of the combined image.
Reach... File / save as...Choose a backup location / enter a file name / choose a format...
On the left, click on the button "Save..." -
question about how to combine the two scripts.
HelloI have a sql script that can display a table (or view) all the information, it works fine. I call it validate_table.sql, as below:
command prompt
accept invites owner "Enter table owner:
accept invites from TABLE_NAME "Enter object (table/View...) "name:"
column owner format a10 column 'owner '.
column format a30 topic 'Object name' object_name
column object_type format a15 direction "Type of object".
Status format a10 column titled "Status".
in the heading of column created format a20 "created."
the LAST_DDL_TIME format a20, heading 'LAST_DDL_TIME.
Select
owner
object_name
object_type
status
, to_char (created, "DD_MON_YY hh24:mi:ss") created
LAST_DDL_TIME,
Of
DBA_OBJECTS
where
object_name = upper ('& table_name') and owner = upper ('& owner');
command promptprompt -- ----------------------------------------------------------------------- ---
Guest - table/view structure-
prompt -- ----------------------------------------------------------------------- ---
command prompt
describe and owner... & table table_namecommand prompt
prompt -- ----------------------------------------------------------------------- ---
guest - list assigned user/subsidies-
prompt -- ----------------------------------------------------------------------- ---
command prompt
set pagesize 50000
set linesize 10000
set verify off
Set feedback off
column lvl format A4 direction "Lvl".
proprietary format of columns A14
format column in table_name A29
A38 dealer column format
column privilege A10 format
SELECT 'Role' lvl, t.table_name, t.grantee, t.owner, t.privilege
OF dba_tab_privs t
WHERE t.grantee IN (SELECT FROM dba_roles role WHERE = role t.grantee) and t.table_name = upper ('& table_name') and t.owner = upper ('& owner')
UNION
SELECT 'User' lvl t.table_name, t.grantee, t.owner, t.privilege
OF dba_tab_privs t
WHERE t.grantee IN (SELECT username FROM dba_users WHERE username = t.grantee) and t.table_name = upper ('& table_name') and t.owner = upper ('& owner')
UNION
SELECT 'Pub' lvl, t.table_name, t.grantee, t.owner, t.privilege
OF dba_tab_privs t
WHERE t.grantee = 'PUBLIC' and t.table_name = upper ('& table_name') and t.owner = upper ('& owner')
ORDER BY 1, 2, 3;command prompt
prompt -- ----------------------------------------------------------------------- ---
guest - list of synonyms created.
prompt -- ----------------------------------------------------------------------- ---
command prompt
proprietary format of columns A15
synonym_name A20 column format
A15 table_owner column format
format column in table_name A40
DB_link A40 column formatSelect the owner, synonym_name, table_owner, table_name, DB_link from DBA_synonyms where Table_name = upper ('& table_name') stopped by the owner;
command promptprompt -- ----------------------------------------------------------------------- ---
guest - list index created-
prompt -- ----------------------------------------------------------------------- ---
command prompt
Select
table-name
index_name
index_type
nom_tablespace
status
of DBA_indexes
WHERE table_name = upper ('& table_name') and owner = upper ('& owner')
order of table_name, index_name;
command promptprompt -- ----------------------------------------------------------------------- ---
guest - list of constraints-
prompt -- ----------------------------------------------------------------------- ---
command prompt
format column in table_name A15
format of column cons_type A15
cons_name A20 column format
check_cons A25 column format
VALIDATED A20 column format
column status A10 format
last_change A20 column formatSelect
table-name
(case constraint_type
When 'P', then 'Primary Key '.
When 'R' then 'Foreign Key'
When 'C' then 'check '.
When 'U' then 'single '.
When 'o' then 'read only display '.
When 'V' then 'check the view. "
When 'H' then 'Hash expression. "
When 'F' then 'REF column.
When the of ' then 'additional logging.
cons_type end)
constraint_name cons_name
condition_de_recherche check_cons
status
VALID
last_change
of dba_constraints
where owner = upper ('& owner')
and table_name = upper ('& table_name')
order of cons_type;I have another script that allows to display the newly created tables (table, table names) in the last 24 hours.
SET SERVEROUTPUT ON;
DECLARE
CURSOR tmp_cur IS
SELECT master, object_name
FROM dba_objects
WHERE object_type in ('TABLE', 'SEE') and the owner not in ('SYS', 'SYSTEM', 'GENERAL', "XDB", "OUTLN", "SYSMAN") and last_ddl_time > sysdate - 1;
tmp_rec tmp_cur % ROWTYPE;
BEGIN
FOR tmp_rec IN tmp_cur LOOP
DBMS_OUTPUT. PUT_LINE)
tmp_rec. Owner | ' ' || tmp_rec.object_name);
END LOOP;
END;
/
The gap of the first script (validate_table.sql) is that it can only check table one by one by manual entry, then how can I combine these two scripts, to make a scipt that can check all newly created tables (not a table) in the last 24 hours?
I thank very you much in advance!
Hello
If you already know how to find the owner and all the tables created table_name recently. One thing you can do is to change all the WHERE clauses in validate_table.sql, so instead of things like
where object_name = upper ('& table_name') and owner = upper('&owner');
you say
WHERE (owner, object_name) IN
(
SELECT master, object_name
FROM dba_objects
WHERE object_type in ('TABLE', 'SEE')
AND owner NOT IN ('SYS', 'SYSTEM', 'GENERAL', "XDB", "OUTLN", "SYSMAN")
AND last_ddl_time > SYSDATE - 1
)
;
Here is another approach:
Validate_table. SQL is quite handy as it is. You may want to run this script for tables, even when you know that they are not new. Divide into 2 scripts: one called ask_and_describe_table.sql, which looks like this:
-Ask_and_Describe_Table.sql
accept invites owner "Enter table owner:
accept invites from TABLE_NAME "Enter object (table/View...) "name:"
-You can use any name path instead of d:\some_dir below:
@d:\some_dir\describe_table & owner, table_name
and the other one called Describe_Table.sql, which starts like this:
-Describe_Table.sql
DEFINE owner = & 1
DEFINE table_name = & 2
column owner format a10 column 'owner '.
...
and continues with the same exact content as validate_table.sql.
Now, to write another script (I'll call it Describe_Recent_Tables.sql):
-Describe_Recent_Tables.sql - create and run Describe_Many_Tables.sql
-Turn OFF the devices designed to help people to read the output:
SET ECHO OFF
SET FEEDBACK OFF
SET PAGESIZE 0
VERRIFY OFF SET
-Create a Describe_Many_Tables.sql:
COIL d:\some_dir\describe_many_tables.sql
SELECT ' @d:\some_dir\describe_table '
|| owner
|| ' '
|| object_name
FROM dba_objects
WHERE object_type in ('TABLE', 'SEE')
AND owner NOT IN ('SYS', 'SYSTEM', 'GENERAL', "XDB", "OUTLN", "SYSMAN")
AND last_ddl_time > SYSDATE - 1;
SPOOL OFF
-Features lighting designed to help people to read the output:
SET ECHO ON
SET FEEDBACK ON
SET PAGESIZE 50
SET VERRIFY ON
-Describe_Many_Tables.sql performance
@d:\some_dir\describe_many_tables
I guess that all of your tables have standard names (for example, start with a letter, no spaces in the name,...), which don't require quotation marks. If they could, then the same basic approach will work, but the details are a little messier.
When you want to see the information on a single table or view, no matter how old it is, driven
Ask_and_Describe_Table
or, if you do not need to question the owner of the table and the name, something like
Describe_Table SCOTT EMP
(You can find that you really need not Ask_and_Describe_Table.sql).
When you want to do this for all the tables created in the last 24 hours:
Describe_Recent_Tables
-
I currently have a creative cloud with an e-mail account, however I have a behance with an e-mail account that I have had for many years (even Adobe and Behance made before part of the same group). Can I combine these two accounts into one? I want to use the account that I pay cloud Creative if I can use the new portfolio feature.
Thank you.
This is an open forum, not Adobe support... below to connect with Adobe personnel to help
While the forums are open 24/7 you can't contact Adobe support at any time
Chat support: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">===>
Don't forget to stay signed with your Adobe ID before accessing the link below
Creative cloud support (all creative cloud customer service problems)
-
Help to combine the two queries with dependencies
Combining two queries with dependencies:First ask: Returns USER_ID that has a type of access to a table with the OWNER (I also shoot the TLA of the USER_ID standard: ' of TLA #)Select distinct SUBSTR (DBA_USERS. Username, 2, 3) AS TLA
DBA_USERS. Username USED_ID
DBA_TAB_PRIVS. Owner OWNER
from DBA_USERS
DBA_ROLE_PRIVS
DBA_TAB_PRIVS
where DBA_USERS. Username = DBA_ROLE_PRIVS. Dealer
and DBA_USERS.default_tablespace not in ('SYSTEM', "SYSAUX")
and DBA_USERS. Username like would be %'
and DBA_ROLE_PRIVS. Granted_role = DBA_TAB_PRIVS. Dealer
and SUBSTR (DBA_USERS. Username, 2, 3) <>DBA_TAB_PRIVS. Owner
;
Example of results (red font used in the last citation):TLA USED_ID OWNER
--- ------------------------------ ------------------------------
DGTX999 GTX GRR
DGTX999 GTX ABG
DGTX999 GTX HTC
FWS DFWS999 GRR
OCN DOCN999 GRR
RHR DRHR999 DAS
ETM DETM999 DAS
FWS DFWS995 DAS
CD DCDS999 DAS
ABE DABE999 DAS
Second request: matches the USER name (same standards as above) and MACHINES (filter PC connections) and the number of connections made ofSelect DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
COUNT (*) AS CONN_COUNT
of DBA_HIST_ACTIVE_SESS_HISTORY
DBA_USERS
where DBA_HIST_ACTIVE_SESS_HISTORY. User_id = DBA_USERS. User_id
and DBA_USERS. Username like would be %'
and DBA_HIST_ACTIVE_SESS_HISTORY. Machine not as "WINAD%\%-%".
Group of DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
order by 1
3 desc;
Example of results (red font used in the last citation):MACHINE CONN_COUNT USERNAME
--------------- ------------------------- ----------
DFWS999 home13e0 7557
DGAM800 vu1246 37
DGAM999 vu1246 2558
DABE999 back18cb 4639
DINL888 home162f 84
DFWS999 WINDAD\OMHQ58BF 178
DCDS999 back18cb 788
DGTX999 home18c8 7
DGTX999 home13d3 62
DOCN999 vu1261 44
DFWS999 back1976 3
DCDS999 home18c8 173
DGTX999 home19c9 13
What I'd like to have (just made two first USER_IDs from the first query) (COL duplicated for each separate owner 1-4). So 3 machines and 3 owners would result in 9 lines (I could reorganize the collar and use a 'pause'):
TLA USED_ID MACHINE CONN_COUNT OWNER
--- ------------------------------ ------------------------- ---------- ------------------------------
GTX DGTX999 home13d3 62 GRR
Home18c8 GTX DGTX999 7 GRR
DGTX999 GTX home19c9 GRR 6
GTX DGTX999 home13d3 62 ABG
DGTX999 GTX home18c8 ABG 7
DGTX999 GTX home19c9 6 GBS
GTX DGTX999 home13d3 62 CTH
DGTX999 GTX HTC 7 home18c8
DGTX999 GTX home19c9 6 HTC
FWS DFWS999 home13e0 7557 GRR
FWS DFWS999 WINDAD\OMHQ58BF 178 GRR
FWS DFWS999 back1976 GRR 3
So it would be logically read: TLA as USER_ID of MACHINE, CONN_COUNT consultation times: OWNER information.Thought as only those with the necessary values. Just try this and let me know in the case of all conflicts in the output.
WITH T1 AS)
Select distinct SUBSTR (DBA_USERS. Username, 2, 3) AS TLA
DBA_USERS. Username USED_ID
DBA_TAB_PRIVS. Owner OWNER
ROWNUM RN
from DBA_USERS
DBA_ROLE_PRIVS
DBA_TAB_PRIVS
where DBA_USERS. Username = DBA_ROLE_PRIVS. Dealer
and DBA_USERS.default_tablespace not in ('SYSTEM', "SYSAUX")
and DBA_USERS. Username like would be %'
and DBA_ROLE_PRIVS. Granted_role = DBA_TAB_PRIVS. Dealer
and SUBSTR (DBA_USERS. Username, 2, 3) <> DBA_TAB_PRIVS. Owner),
() AS T2
Select DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
COUNT (*) AS CONN_COUNT
of DBA_HIST_ACTIVE_SESS_HISTORY
DBA_USERS
where DBA_HIST_ACTIVE_SESS_HISTORY. User_id = DBA_USERS. User_id
and DBA_USERS. Username like would be %'
and DBA_HIST_ACTIVE_SESS_HISTORY. Machine not as "WINAD%\%-%".
Group of DBA_USERS. Username
DBA_HIST_ACTIVE_SESS_HISTORY. Machine
order by 1
3 desc)
SELECT T1. TLA
, T1. USED_ID
, T2. MACHINE
, T2. CONN_COUNT
, T1. OWNER
FROM T1
T2
WHERE T1. USED_ID = T2. USER NAME;
-
Try to combine the two queries
I have two queries of tables in which I combine and summarize the results in a single value. Could someone let me know what it is that im missing here? Thank you
Deanna
Output current:
SUM
5
10
The output I want to see:
SUM
15
My paintings:
TABLE 'CHART '.
CASE_NUMBER - VARCHAR2
PER_INV_FATALITIES - NUMBER (5.0)
ASSIGNEDDATE_CHART - DATE
TABLE "VEHICLES".
CASE_NUMBER - VARCHAR2
VEHICLE_FATALITY #-NUMBER (5.0)
Current SQL query:
SELECT SUM(ct) FROM ( SELECT SUM(vehicle_fatality#) ct FROM vehicles inner join chart on vehicles.case_number=chart.case_number WHERE vehicle_fatality#>=1 AND ASSIGNEDDATE_CHART BETWEEN TO_CHAR(TRUNC(SYSDATE,'RR'),'DD/MON/RR')AND SYSDATE) union all SELECT SUM(ct) FROM ( SELECT SUM(per_inv_fatalities) ct FROM chart WHERE PER_INV_FATALITIES>=1 AND ASSIGNEDDATE_CHART BETWEEN TO_CHAR(TRUNC(SYSDATE,'RR'),'DD/MON/RR')AND SYSDATE);
Hello
Instead of:
SELECT SUM (ct) FROM (query_a) UNION ALL SELECT SUM (ct) FROM (query_b) ;
do
SELECT SUM (ct) FROM ( query_a UNION ALL query_b ) ;
SUM without GROUP BY will produce a line.
If you do a UNION ALL of two queries of this type operation, you will get two rows.
The UNION ALL first, then make a single SUM on the combined results. -
How to merge these two files?
Hello Adobe Dreamweaver Forums.
My Question:
How to merge the two following documents of smaller.js in a document unique largest .js?
I took action:
Copy and paste.
Problem:
Scripts is no longer loading in the larger document, still charge when connected separately.DOWNLOAD:
Dropbox - merge help (05/16/15) .zip
Includes:
"Main.js" - 51 lines, 30KB
'Fusion-in-hand-1 Jquery.nav' - 2 lines, 1 KB
"Fusion-in-hand-2 settings" - 2 lines, 1 KB
Note:
If the necessary script files can be unpacked using: Unminify JS, CSS and HTML Code
Thanks for reading and I appreciate the help.
Not sure what you mean "files are not can-do. In the example, I have even included the jQuery library in goldenrolls.js.
The only problem you will have is the time it takes to load the page. Take a look at the size of the header image which is ko 5 769,21 with the dimensions of 3, 072px × 2, 304px (scaling 1, 180px × 885px).
Once the page is loaded, everything works perfectly.
-
How to combine the two fonts in a logo type?
I've created a customer logo ID, consisting of two fonts. The name of the customer is Trajan Pro. The logo must also include a "Registered" symbol (the circled R) after the name. Unfortunately, using Trajan Pro mode Exhibitor does not look good, especially scaling down and with a circle around the R. To work around this problem, I used the Arial font to create the® in a supplemental box, be able to fine tune its size and position. It's great for once, but I would like to be able to combine the two so that the name of the customer in Trajan Pro and the symbol "Recorded" in Arial can be re-scaling or repositionnes in unison and saved for future use. What is the best way to do it? Here is an article of the logo to demonstrate what I have:
Select the two text blocks and go to Type > vectorize. Group them. Now that you have drawn, no text. It is usually a good idea to save a logo in a separate file, which can be placed. Put the logo in its own file on one page of appropriate size. Save the file and export a PDF of print quality. Link to the PDF file when using the logo in other files.
-
How to combine several physical queries
Hi all
I have a large reports with more 70-80 columns in response. This isn't a report of Pivot. Now it generates 3 physical motion.
I need to merge this 3 requests in a single request. But it seems very difficult to implement.
Two points:
1 report generates 3 physical motion. All queries are queries GROUP BY, and each of them giving different count separately
2. If we find a way to combine. The result would be different answers report result (that's my assumption)
3. how the answer is combining the results of 3 queries and we show the result?
No entry or thought is appreciated top.
I'm totally stuck in there. Tried in different ways. But is there a solution for this that I'm not able to think?
Pls Help
Thanks in advance
Concerning
NathalieHello
In the answers--> tab check the sql issued. How the tool takes the query. Hope It will help you write a sql query. -
combining these two programs...
I have two programs I want to combine into one. I have a vision of the solar system that shows the solar system as a whole, and I also have another program where you can individually view the planets by clicking a button to load. What I want to be able to do is I can click on a planet in solar system model (which shows all of the solar system) and set up the global view that I have. I have two things I need to do:
(i) a mouse event to allow the user to click on a planet in full view of the solar system and load the 3D representation of this planet
(II) a way to separate my planet so program so that each planet has its own code so that they can be clicked on individually
Lets start with number 1:
My code for solar system model:
onClipEvent (load) {}
function {path (t1, t2)
return Math.sqrt (t1 * t1 + t2 * t2);
}function {} Dim
showLabel =! showLabel;
If (showLabel) for (k = 0; k < count; k ++) this .info [k] = n [k];
else for (k = 0; k < count; k ++) this .info [k] = "";
}C1 = new Array(); coordinates of the endpoints of each ellipse conjugate diameters
C2 = new Array();
C3 = new Array();This.Drag._x = 800; zoom setting
This.Drag._y = - 100; elevation adjustment
showLabel var = false;Planetary orbital elements (J2000)
J2000 = new Date (2000, 0, 0, 12);
n = new Array ('Mercury', 'Venus', 'Earth', 'March', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Quaoar', 'Varuna');
a = new Array (0.38709893, 0.72333199, 1.00000011, 1.52366231, 5.20336301, 9.53707032, 19.19126393, 30.06896348, 39.48168677, 17.94175491, 43.373493, 13.6209635, 43.2718562);
e = new Array (0.20563069, 0.00677323, 0.01671022, 0.09341233, 0.04839266, 0.05415060, 0.04716771, 0.00858587, 0.24880766, 0.96727724, 0.037457, 0.3809974, 0.0529874);
I have = new Array (7.00487, 3.39471, 0.00005, 1.85061, 1.30530, 2.48446, 0.76986, 1.76917, 17.14175, 162.24220, 7.992, 6.93691, 17.12943);
o = new Array (48.33167, 76.68069,-11.26064, 49.57854, 100.55615, 113.71504, 74.22988, 131.72169, 110.30347, 58.86004, 188.923, 209.32713, 97.28538);
w = new Array (77.45645, 131.53298, 102.94719, 336.04084, 14.75385, 92.43194, 170.96424, 44.97135, 224.06676, 111.86560, 156.292, 339.09846, 275.22088);
l = new Array (252.25084, 181.97973, 100.46435, 355.45332, 34.40438, 49.94432, 313.23218, 304.88003, 238.92881, 115.68, 267.1875, 48.62884, 83.80675);
p = new Array (87.969 224.701 365.256, 686.980, 4332.589, 10759.22, 30685.4, 60189, 90465, 27795, 105192, 18573, 104096);
CR = Math.PI/180;
today = new Date();
DT = (today - J2000) / 864th + 5;
Count = n.length;
Inc = 1;
var pre = null; Drag the motion detect
Zoom = 8;
d = new Array();
B = new Array();
Co = new Array();
So = new Array();
This = new Array();
TR = new Array();
for (j = 0; j < count; j ++) {}
d [j] = 2 * Math.PI / p [j];
Co [j] = Math.cos (o [j] * cr);
Yes [j] = Math.sin (o [j] * cr);
This [j] = Math.cos (I [j] * cr);
If [I] = Math.sin (I [j] * cr);
u [j] = (w [j] + l [j]) * cr;
b [j] = Math.sqrt ((1 + e[j]) / (1 - e [j]));C1 [j] = FRT (0);
C2 [j] is equal to traf(Math.PI / 2);
C3 [j] = FRT (3 * Math.PI/2);this.attachMovie ("ellipse", count + j, j);
this.attachMovie ("dot", j, j + count);
if(j > 8) this ._alpha [j] = this [count + j] ._alpha = 50;
}function FRT (e1) {}
vector = new Object();
var v = 2 * Math.atan (b [j] * Math.tan (e1/2)) + u [j];
var r = a [j] * (1 - e [j] * Math.cos (e1));
Vector.x = r * (co [j] * Math.cos (v) - so [j] * this [j] * Math.sin (v));
Vector.y = r * (yes [j] * Math.cos (v) + co [j] * this [j] * Math.sin (v));
Vector.z = r * TR [j] * Math.sin (v);
return vector;
}function place (pass) {}
CMX = Math.cos (mx);
SMX = Math.sin (mx);
zoom = 5 + drag._x / 20;
If the zoom (zoom < 1) = 1;
If the zoom (zoom > 120) = 120;
This.Sun._xscale = this.sun._yscale = zoom;
XK zoom = * pass.x;
YK = zoom * (pass.z * smx - pass.y * cmx);
[j] ._x = xk;
[j] ._y = yk;If (pre! = drag._y * drag._x) {/ / if zoomed in or turned transform ellipses}
x 1 = zoom * c1 [j] .x;
Y1 = zoom * (c1 [j] .z * smx - c1 [j] there * cmx);
x 2 = zoom * c2 [j] .x;
Y2 = zoom * (c2 [j] .z * smx - c2 [j] there * cmx);
x 3 = zoom * c3 [j] .x;
Y3 = zoom * (c3 [j] .z * smx - c3 [j] there * cmx);
AX = (x 2 + x 3 + y3 - y2) / 2 - x 1;
Ay = (x 2 - x 3 + y2 + y3) / 2 - y1;
BX = (x 2 + x 3 + y2 - y3) / 2 - x 1;
by = (x 3 - x 2 + y2 + y3) / 2 - y1;
XC = (x 2 + x 3) / 2;
YC = (y2 + y3) / 2;
EK = (bx, by) path / path (ax, ay);
ex = bx + ek * axe;
EY = a + ek * ay;
= path (ex, ey);
and = (ax * ay (xc - x 1) - * (yc - y1)) / (ax * ex + ey * ay);
XM = xc - x 1 - ey * HE;
YM = yc - y1 + ex * HE;
XA = ax - xm;
is = ay - ym;
his path (xm, ym) =;
with (this [count + j]) {}
_x = xc - its * ex /;
FLF = yc - its * ey /;
_xscale = sa;
_yscale = path (xa, ya);
_alpha = 25 + 100 * _yscale / _xscale;
_rotation = 180 * Math.atan2 (- ey, - ex) / Math.PI;
}
}
}function kepler() {}
for (j = 0; j < count; j ++) {}
m = dt * d [j];
E0 = m + e [j] * Math.sin (m);
E0 = m + e [j] * Math.sin (e0);
place (FRT (e0));
}
}
}onClipEvent (enterFrame) {}
MX = this.drag._y * cr / 2;
Kepler();
pre = this.drag._y * this.drag._x;
+= DT inc.;
}where I would put a mouse event that allows the user to click on a planet in full view of the solar system and load the 3D representation of this planet?
Thanks for any help!
The code of your solar system is all AS2, AS3 code, so if your code on the planet is AS3 then you will probably need to re-think this - you can't mix the two languages in a single file. If your planet code is AS2, then you should post in the AS2 forum.
-
How to combine multiple regex queries in a script?
Hello
is it possible to combine several queries regex in JavaScript? I export text from a database with custom labels and regex queries interpret the text AND character style replacements.
example of
Let's say my exported text is as follows
"I have a very large text of < tag_bold > < / tag_bold > that includes a large number of styles of different characters, such as < tag_bold >"BOLD"< / tag_bold >, < tag_italic > italic < / tag_italic >, < tag_bold >"BOLD"with certain < tag_bold_underline > underlined words < / tag_bold_underline > < / tag_bold >. ,
«to the words with different < tag_size-2 > text size < / tag_size-2 >»
The result I want is
"I have a very large text that includes a large number of styles of different characters, such as bold, italic,
"BOLD", with a few words that are underlined, or never words with different text size.
Note that all the tags open and close in the same paragraph and there's nested pairs of tags in some cases. If I run my requests (more than 20) of the outer pair the inner exception, i.e.:
< tag_bold >... < / tag_bold >
< tag_italic >... < / tag_italic >
< tag_size-2 >... < / tag_size-2 >
< tag_bold_underline >... < / tag_bold_underline >
Thanks in advance for your help
DPS
If your character style name and tag name so I think it's a complete solution for you
try code below:
myDoc var = app.activeDocument;
var charastyles = myDoc.characterStyles.everyItem () .name;
for (a = 1;
{
repl_charastyles (charastyles [a])
}
function repl_charastyles (charstyle)
{
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = '<' +="" charstyle="" +="" '="">' + '(.+?)' +="" charstyle="" +="" '="">';
app.changeGrepPreferences.changeTo = ' $1 ';
app.changeGrepPreferences.appliedCharacterStyle = charstyle;
app.activeDocument.changeGrep ();
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
}
Shonky
Maybe you are looking for
-
How to install the Codec OpenH264 of Cisco?
I noticed that almost every time I start my computer and open every night I get a popup to download to download the codec OpenH264 by Cisco. I did and I noticed that there was an entry for it in the Add-ons Manager Plugins section and it says "will b
-
How to enable two-sided printing on MacBook Pro with Canon MX490 printer
Hello I have the MacBook Pro (retina, 13-inch, early 2013) and OS X version 10.11.4 (15E65) and Printer series Canon MX490. When I try to make a double-sided, the printer settings printing does not allow me activate two-sided printing. Also when I go
-
Start on Satellite BIOS password click on L9W Mini-B
Hello everyone,I am now digging some time arround to find a solution to my problem. I have a 'locked' Toshiba Satellite click Mini (L9W - B) convertible. Is it now somehow a "starting password" on this subject.Im not sure if this is a BIOS/UEFI but I
-
I use the N300 Wireless Range Extender, model EX2700. I created this range extender months ago and for some reason, now it does not directly take me to the NETGEAR Smart configuration genius. I tried to reset the Extender to the factory settings and
-
I just bought the Slimline s5360f and specifications that it has under the vertical directions authorized is the only option. Is it a strict requirement for operational of the BD drive well-being or just for the aesthetics of the PC? I have not yet i