Select Max (blocks) in dba_segments
Hello
11.2.0.1
I want to get the bigger picture in terms of number of real blocks occupied my database.
The above command is correct?
Thank you
ESTIMATE_PERCENT-ONLINE DBMS_STATS. AUTO_SAMPLE_SIZE is much more accurate in 11.2
Hemant K Collette
Tags: Database
Similar Questions
-
Select Max (Date) in two different tables...
Dear all,
I need the date of last update of two different tables, I mean max (date). We will update one table at a time. Updated once I need to take the last update.
It can be either in table A table B.
for example.
Table A
Date of the ID
100 16/05/2014
101 20/05/2014
102, 22/05/2014
Table B
Date of the ID
100 04/06/2014
101, 26/05/2014
102 21/05/2014
I need the date of table B (101 26/05/2014) last updated date...
Hello
Another way, using much more GRAND:
SELECT LARGER (max1, max2) x
FROM (SELECT MAX (mydate) max1
OF mytable_a
)
(SELECT MAX (myotherdate) max2
OF mytable_b
)
;
Best regards
Bruno Vroman.
-
Select Max (date) between multiple tables
I need to retrieve a record from a Table in a set of similar tables with a common "date field". You can select the record where this "date field" value is greater between multiple tables.
Here, any help is appreciated. Thank you in advance.
FOR EXAMPLE
No. EMP is the primary key.
Again, each table can have multiple records for EMP n ° 1
TABLE1:
FIRST NAME
FAMILY NAME
THE EMP NO.BASE SALARY
DATE_FROM
TABLE 2
FIRST NAME
FAMILY NAME
THE EMP NO.SALARY GRADE
DATE_FROM
TABLE 3
FIRST NAME
FAMILY NAME
THE EMP NO.COMPENSATION
DATE_FROM
Hello
Said Knani, if you use the current design of the table, then here is a way to do what you want:
WITH union_data AS
(
SELECT MAX (base_salary) AS sal FROM table1 UNION ALL
SELECT MAX (grade_salary) table2 UNION ALL
SELECT MAX (compensation) FROM table3
)
SELECT MAX (sal) AS max_sal
Of union_data
;
-
Select Max (date) multiple records
I'm having a problem getting the last value for several gauges. Here's my query:
SELECT parameter_id,
TS_ID,
value,
Location_id,
Date_Time
Of
MyTable
JOIN IN-HOUSE
mytable2
WE
TS_ID = ts_id
WHERE
TS_ID LIKE '% - rev.
unit_id = ("pi")
the value IS NOT NULL
Location_id as "xxxx".
Date_Time =
(SELECT Max (date_time)
My TABLE
GROUP BY parameter_id)
;
Hello
A scalar subquery, such as the expression to the right of the sign =
Date_Time = (SELECT...)
must produce (at most) only 1 row. If the subquery produces 2 or more lines, it will trigger an error.
Given that you are using "GROUP BY parameter_id" in the subquery, it will produce a separate line of output for each distinct value of parameter_id. You can use a correlated subquery at that time, that only looks like a parameter_id, or you can use a subquery IN, like this:
WHERE (parameter_id, Date_Time) IN
(
SELECT parameter_id
MAX (date_time)
FROM MyTable
GROUP BY parameter_id
)
I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).See the FAQ forum: https://forums.oracle.com/message/9362002#9362002
-
Hello guys, small head scratcher here (probably just my mind head)
Summary of the issue: Updated between two tables, try to use the rank, will not work.
I took a few of the fields of interest here: -.
CREATE TABLE spell_tags ( Spell_ID varchar2(50) , service_line_spell varchar2(25) );
Samples: -.CREATE TABLE ranked_spells( spell_ID varchar2(10) , dominant_SSNDS varchar2(25) , service_line varchar2(25) , Rank varchar2(3) NOT NULL ) ;
Data looks like this: -.INSERT INTO RANKED_SPELLS ("SPELL_ID" ,"DOMINANT_SSNDS" ,"SERVICE_LINE" ,"RANK" ) VALUES ('100002' ,'08' ,'SD08o' ,'213' ); INSERT INTO RANKED_SPELLS ("SPELL_ID" ,"DOMINANT_SSNDS" ,"SERVICE_LINE" ,"RANK" ) VALUES ('100002' ,'08' ,'SD08s' ,'210' ); INSERT INTO RANKED_SPELLS ("SPELL_ID" ,"DOMINANT_SSNDS" ,"SERVICE_LINE" ,"RANK" ) VALUES ('100003' ,'08' ,'SD22m' ,'416' ); INSERT INTO RANKED_SPELLS ("SPELL_ID" ,"DOMINANT_SSNDS" ,"SERVICE_LINE" ,"RANK" ) VALUES ('100003' ,'08' ,'SD23x' ,'207' ); INSERT INTO SPELL_TAGS ("SPELL_ID" , "SERVICE_LINE_SPELL" ) VALUES ('100002' ,'' ); INSERT INTO SPELL_TAGS ("SPELL_ID" , "SERVICE_LINE_SPELL" ) VALUES ('100003' ,'' );
Basically, I need to run and update the declaration (not plsql) to update the Spell_tags table service_line_spell field with the service_line of the ranked_spells table (lowest rank)Select * from spell_tags; SPELL_ID SERVICE_LINE_SPELL -------------------------------------------------- ------------------------- 100002 100003 2 rows selected. Select * from ranked_spells; SPELL_ID DOMINANT_SSNDS SERVICE_LINE RANK ---------- ------------------------- ------------------------- --- 100002 08 SD08o 213 100002 08 SD08s 210 100003 08 SD22m 416 100003 08 SD23x 207 4 rows selected.
Here are a few failed attempts, do not laugh ;)
This is the result, I need: -.update spell_tags set service_line_spell = (select max(service_line) from ranked_spells where spell_tags.spell_id = ranked_spells.spell_ID group by service_line, rank having rank = min(rank)) where spell_ID in (select distinct spell_ID from ranked_spells); ERROR at line 2: ORA-01427: single-row subquery returns more than one row update speccom.spell_tags set service_line_spell = (select b.service_line from ranked_spell b where spell_tags.spell_id = ranked_spells.spell_ID and ranked_spells.rank = min(ranked_spells.rank) group by service_line, rank) where exists (select spell_ID from ranked_spells where spell_ID in (select distinct spell_ID from ranked_spells); ERROR at line 4: ORA-00934: group function is not allowed here
Any ideas guys?Select * from spell_tags; SPELL_ID SERVICE_LINE_SPELL -------------------------------------------------- ------------------------- 100002 SD08s 100003 SD23x
Something like that?
update spell_tags set service_line_spell = (select max(service_line) keep (dense_rank last order by rank desc) from ranked_spells where spell_tags.spell_id = ranked_spells.spell_ID ) where spell_ID in (select distinct spell_ID from ranked_spells);
Published by: UW (Germany) on 16.08.2012 16:48 (changed min at the maximum, but it makes only a difference when there is same ranking values)
-
How to select a block of text to the Script name?
Hello
I have listed the text block in the code below,
UIDRef uidreference = stories->GetNthTextModelUID(0);
InterfacePtr<ITextModel> TheTextModel (uidreference, UseDefaultIID());
if (TheTextModel is NOTHING)
Break;
IFrameList * Frames = TheTextModel->QueryFrameList();
if (Frameworks is NOTHING)
Break;
AFrameUID UID = images->GetNthFrameUID(0);
I need to select the block of text by Script name (Windows-> Utitities-> Script title).
Please suggest the solution above the problem.
Try,
InterfacePtr
script (content, UseDefaultIID()); If {(script)
ScriptLabelValue = script PMString-> GetTag();
CAlert::WarningAlert (scriptLabelValue);
}
-
Select the block of text on each page of a sudden and resize them
Hello, I want to do a 400 pages of text. How can I select the block of text on each page of a sudden and change their size at the same time? (each block of text is the same size per page)
Make a backup copy of the file incase something goes wrong, then:
Ensure that executives align on the margins on all sides - change margins of the master page applied to achieve, if necessary.
Allow the adjustment of the layout (layout > setting layout...)
On the master page, change the margins to be the size you want the new text frame dimensions to be.
If, for some strange reason, you won't use these margin settings in the layout, turn off the setting of page layout and reset them on the master page again to what you want.
-
With the help of SELECT MAX (Substr (in a subquery to return specific lines
Oracle v10
Here is an example of a query and the output
I try to return only the last line of data, in this case the line 2005.SELECT ID, SAMPLEID, COMPOUNDNAME, REQUISITION, SUBSTR(REQUISITION,2,4) FROM SEARCH PL1 WHERE SAMPLEID = 'IA 0005 0166'; 86907 IA 0005 0166 IA 0005 R2004:001160 2004 98158 IA 0005 0166 IA 0005 R2005:000956 2005
I tried
But it returns no results. According to me, only missing me something simple.SELECT ID, SAMPLEID, COMPOUNDNAME, REQUISITION, SUBSTR(REQUISITION,2,4) FROM SEARCH PL1 WHERE SAMPLEID = 'IA 0005 0166' AND REQUISITION IN (SELECT MAX(SUBSTR(REQUISITION,2,4)) FROM SEARCH PL2 WHERE SUBSTR(PL2.REQUISITION,2,4) = SUBSTR(PL1.REQUISITION,2,4));
TIAYou probably meant it?
SELECT ID, SAMPLEID, COMPOUNDNAME, REQUISITION, SUBSTR(REQUISITION,2,4) FROM SEARCH PL1 WHERE SAMPLEID = 'IA 0005 0166' AND SUBSTR(REQUISITION,2,4) = ( SELECT MAX(SUBSTR(PL2.REQUISITION,2,4)) FROM SEARCH PL2 WHERE PL2.SAMPLE_ID = PL1.SAMPLE_ID );
that could also be achieved with a single table access:
SELECT id, sampleid, compoundname, requisition, sub_req FROM ( SELECT id, sampleid, compoundname, requisition, substr(requisition,2,4) sub_req, row_number() over(order by substr(requisition,2,4) desc) rn FROM search PL1 WHERE sampleid = 'IA 0005 0166' ) WHERE rn = 1 ;
-
Select the block of text to items found
Hi experts
Here I find etc using the character style. I found myself results. Now, what is my need I want to select the block of text for the element found.
app.findPreferences = NothingEnum.nothing;
app.changePreferences = NothingEnum.nothing;app.findPreferences.appliedCharacterStyle = "FigCallout";
var myResults = app.activeDocument.search ();
for (i = myResults.length - 1; i > = 0; i--)
{
Select the block of text where myResults [i]}
I use CS2 Windows.
Thanks in advance
concerning
a you are the
Memory: .parentTextFrame myResults [i]?
-
SELECT MAX (FILE_VERSION)
I put the following portion of the code in a WHERE clause:
.. .but for records where the FILE_VERSION is null or doesn't retrieve any record.AND PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION IN (SELECT MAX(FILE_VERSION) FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_4 WHERE PCMS_CHDOC_ACTION_DESC_4.CH_UID = PCMS_CHDOC_DATA_2.CH_UID AND PCMS_CHDOC_ACTION_DESC_4.CH_DOC_ID = PCMS_CHDOC_DATA_2.CH_DOC_ID)
There is a way to write such can also retrieve records that are null?AND (PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION IN (SELECT MAX(FILE_VERSION) FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_4 WHERE PCMS_CHDOC_ACTION_DESC_4.CH_UID = PCMS_CHDOC_DATA_2.CH_UID AND PCMS_CHDOC_ACTION_DESC_4.CH_DOC_ID = PCMS_CHDOC_DATA_2.CH_DOC_ID ) OR PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION IS NULL)
or doesn't exist doesn't retrieve any record.
What do you mean by that?
* 009 *.Published by: 009 April 16, 2010 12:14 AM
-
Select max in a specific range only?
Hello experts and pros of sql!
I guess that I need your help on a problem I've been struggling with for hours now.
I have the following query, which, in the final version will be written in the pl/sql code:
My problem is that I want to select MAX (M.LNG_ARBEITSSCHRITT) while the max value is supposed to be limited to a specific range.SELECT CNT_GEBIET, CNT_GEBIET DISPLAY, CNT_GEBIET BUTTON, STR_NAME, decode(STR_ART_GEBIETE,'Vogelschutz','SPA','FFH','FFH','FFH und Vogelschutz','FFH & SPA') STR_ART_GEBIETE, STR_REG_KART_TEAMS, STR_BESCHREIBUNG, BOOL_ANZEIGEN, STR_FEDERFUEHRENDE, K.INT_VERFAHREN, STR_VERFAHREN, D.ST_BIOGEO, D.STR_GEBIET, E.STR_BIOGEO, E.INT_BIOGEO, case when to_char(min(L.DATE_GP_RT_END), 'YYYY') < to_char(sysdate, 'YYYY') then 'red' else 'green' end as mxcolour, case when to_char(min(L.DATE_R_AT_END), 'YYYY') <= to_char(sysdate, 'YYYY') then 'green' when to_char(min(L.DATE_R_V_END), 'YYYY') > to_char(min(L.DATE_GP_V_END), 'YYYY') then 'red' else 'black' end as mxcolour_r_date, to_char(min(L.DATE_GP_AT_START), 'YYYY') DATE_GP_AT_START, to_char(min(L.DATE_R_AT_END), 'YYYY') DATE_R_AT_END, to_char(min(L.DATE_GP_V_START), 'YYYY') DATE_GP_V_START, to_char(min(L.DATE_R_V_END), 'YYYY') DATE_R_V_END, to_char(min(L.DATE_GP_RT_START), 'YYYY') DATE_GP_RT_START, to_char(min(L.DATE_R_RT_END), 'YYYY') DATE_R_RT_END, I.GEB, I.STR_REGBEZE, H.ALF, I.LNG_REG_KART_TEAMS, MAX(NVL(M.LNG_ARBEITSSCHRITT,21)) LNG_ARBEITSSCHRITT FROM VT_TBL_ARBEIT_ZU_GEBIET M RIGHT OUTER JOIN ( VT_TBL_GEBIET K INNER JOIN VT_TBL_ART_GEBIETE B ON B.CNT_ART_GEBIETE = K.INT_ART_GEBIET INNER JOIN VT_TBL_FEDERFUEHRENDE C ON C.CNT_FEDERFUEHRENDE = K.LNG_FEDER INNER JOIN VT_TBL_GEBIET_ZU_BIOGEO D ON D.STR_GEBIET = K.CNT_GEBIET INNER JOIN VT_TBL_BIOGEO E ON D.ST_BIOGEO = E.INT_BIOGEO INNER JOIN VT_TBL_VERFAHREN F ON F.CNT_VERFAHREN = K.INT_VERFAHREN INNER JOIN VT_TBL_REG_KART_TEAMS G ON G.CNT_REG_KART_TEAMS = K.INT_REG_KART_TEAMS INNER JOIN VT_TBL_GEBIET_ZU_ALF H ON H.GEBIET = K.CNT_GEBIET INNER JOIN TBL_REGBEZE I ON I.GEB = K.CNT_GEBIET AND I.LNG_REG_KART_TEAMS = G.CNT_REG_KART_TEAMS ) ON M.LNG_GEBIET = K.CNT_GEBIET LEFT OUTER JOIN TBL_ARBEITSSCHRITTE_NEU A ON M.LNG_ARBEITSSCHRITT = A.CNT_ARBEITSSCHRITT left outer join vt_tbl_arbeit_crit_date l on l.lng_gebiet = k.cnt_gebiet where k.cnt_gebiet not like '%Test%' and nvl(m.lng_arbeitsschritt,21) not in (1,4,13,23,28,31,45,54,60,66,73,78) and nvl(l.lng_arbeitsschritt,1) = 1 GROUP BY CNT_GEBIET, STR_NAME, STR_ART_GEBIETE, STR_REG_KART_TEAMS, LNG_REG_KART_TEAMS, H.ALF, STR_BESCHREIBUNG, BOOL_ANZEIGEN, STR_FEDERFUEHRENDE, D.ST_BIOGEO, D.STR_GEBIET, E.STR_BIOGEO, E.INT_BIOGEO, F.STR_VERFAHREN, K.INT_VERFAHREN, I.GEB, I.STR_REGBEZE, L.DATE_GP_AT_START, L.DATE_R_AT_END, L.DATE_GP_V_START, L.DATE_R_V_END, L.DATE_GP_RT_START, L.DATE_R_RT_END
Indeed, the 1,4,13,23,28,31,45,46,54,60,66,73,78 values should not take into account.
Can you please show me how to specify a range of values that can be used for the calculation of the max (m.lng_arbeitsschritt)?
I appreciate your help and your entry!
Thank you to have a look at this post!
Kind regards
SEBTry:
max(case when M.LNG_ARBEITSSCHRITT not in (1,4,13,23,28,31,45,46,54,60,66,73,78) then M.LNG_ARBEITSSCHRITT end)
-
Select max (length) - how to display the length of a group MAX
Hello
I have a table with the name of DVD and names of files on the DVD.
I would like to know how to change this query to get another column, MAX_LENGHT, the MAXIMUM length of the name of FILE to a DVD of return
This doesn't work request
DESIRED RESULTselect DVD, FILENAME, (SELECT max(length(FILENAME)) / 2 + 4 FROM TABLE) AS MAX_LENGHT from TABLE
Thank youDVD FILENAME MAX LENGHT DVD1 Alina 8 DVD1 Aidan 8 DVD1 Aiden 8 DVD1 Akira 8 DVD1 Alex 8 DVD1 Alyssa 8 DVD1 Arianna 8 DVD1 Ashley 8 DVD1 Ava 8 DVD1 Benjamin8 DVD1 Bianca 8 DVD1 Blake 8 DVD1 Brandon 8 DVD1 Brayden 8 DVD1 Brayden 8 DVD1 Brianna 8 DVD1 Brielle 8 DVD1 Brooklyn8 DVD2 Dakota 11 DVD2 Dalia 11 DVD2 Daniel 11 DVD2 Dante 11 DVD2 David 11 DVD2 Diego 11 DVD2 Dingbang11 DVD2 Dominic 11 DVD2 Dylan 11 DVD2 Chase 11 DVD2 Chloe 11 DVD2 Christopher 11 DVD2 Claire 11 DVD2 Cole 11 DVD2 Connor 11
RoselineYou can use the analytic version of the function max:
SELECT DVD , FILENAME , MAX(LENGTH(FILENAME)) OVER (PARTITION BY DVD) AS MAX_LENGTH FROM TABLE
-
HELP! : SELECT &; MAX
I had a few difficulties to do a sql query.
Table 1: Master
2 columns: name, Contact_ID
Name1, contact_id_1
name 2, contact_id_2
name 3, contact_id_3
...
Table 2: details
2 columns: Version Contact_id, address,.
contact_id_1, address_a, 1
contact_id_1, address_b, 2
contact_id_2, address_c, 1
contact_id_2, address_d, 2
contact_id_2, address_e, 3
contact_id_3, address_f, 1
......
Question I have:
How can I make a query showing the list of names with the address with the latest version?
Result: I'm looking:
Name1, address_b
name 2, address_e
name 3, address_f
.......
--------------------------
Thank you very much for the help in advance!with master as ( select 'name1' as name, 'contact_id_1' as contact_id from dual union all select 'name2' as name, 'contact_id_2' as contact_id from dual union all select 'name3' as name, 'contact_id_3' as contact_id from dual ), detail as ( select 'contact_id_1' as contact_id, 'address_a' as address, 1 as version from dual union all select 'contact_id_1' as contact_id, 'address_b' as address, 2 as version from dual union all select 'contact_id_2' as contact_id, 'address_c' as address, 1 as version from dual union all select 'contact_id_2' as contact_id, 'address_d' as address, 2 as version from dual union all select 'contact_id_2' as contact_id, 'address_e' as address, 3 as version from dual union all select 'contact_id_3' as contact_id, 'address_f' as address, 1 as version from dual ) -- -- end of test data, query is below -- select m.name, d.address from master m, detail d where m.contact_id = d.contact_id and d.version = (select max(version) from detail d2 where d2.contact_id = d.contact_id) / NAME ADDRESS ----- --------- name1 address_b name2 address_e name3 address_f 3 rows selected
Published by: Cyn on December 17, 2009 16:39
-
Unexpected result with select max (colmn) in anonymous block
Hello
The following query gives me 28 800 like sum (sal)
But when I use the above query in anonymous block, it gives me 684400SELECT SUM(salary) FROM employees WHERE department_id =60 O/P is : 28800
Exit instructions above gives me 684400 as output... But the grounds are 28800DECLARE v_sum_sal NUMBER; department_id employees.department_id%TYPE := 60; BEGIN dbms_output.put_line ('The department_id is'||department_id); SELECT SUM(salary) into v_sum_sal FROM employees WHERE department_id = department_id ; dbms_output.put_line ('The sum of sal is'||v_sum_sal); END;
You can me why the output differs block anonymous reference pleaseHello
What about prefixing all your PL/SQL variables so that they do not match a column_name :
DECLARE v_sum_sal NUMBER; v_department_id employees.department_id%TYPE := 60; BEGIN dbms_output.put_line ('The department_id is'||v_department_id); SELECT SUM(salary) into v_sum_sal FROM employees WHERE department_id = v_department_id ; dbms_output.put_line ('The sum of sal is'||v_sum_sal); END;
Because, with the first names, where clause was equivalent to:
where 1=1
-
Ultiboard select HIERARCHICAL block
Normal 0 false false false MicrosoftInternetExplorer4 / * Style Definitions * / table. MsoNormalTable {mso-style-name: "Table Normal" "; mso-knew-rowband-size: 0; mso-knew-colband-size: 0; mso-style - noshow:yes; mso-style-parent:" ";" mso-padding-alt: 0 cm 0 cm 5.4pt 5.4pt; mso-para-margin: 0 cm; mso-para-margin-bottom: .0001pt; mso-pagination: widow-orphan; do-size: 10.0pt; do-family: "Times New Roman"; mso-ansi-language: #0400; mso-fareast-language: #0400; mso-bidi-language: #0400 ;} "}
Short: I want to select components in ultiboard, which belongs to a specific hierarchical block in multisim. Secondary attribute to a group of party in ultiboard.
Best show a column in the list parts view with the hb_sc_name property already contained in the file .ewnet for each instance of the component and allow sorting by this column. Then you can easily select all parts with a specific hb_sc_name and change their "party group.
Or something similar.
Hi tfa.
You can do it, but only from Multisim. It also will not work in Multisim 10.1 and earlier versions, because part groups (also part spacing, pin swap and Exchange door) where no specific instance as they are now.
- In Multisim, open the main design and select the hierarchical block that you want to change.
- In worksheet view, select the components tab
- Make sure show all is not selected
- Click the column heading of the Group of the party to select the entire column
- Select one of the items, and change the name
NOTE: when you select the item, you must select a component that can be a part of the Group (for example, by selecting a HB/SC connector, you cannot change the name of party group).
Maybe you are looking for
-
El capitan will not download.
I first tried to move to El Capitan a week ago, but I quickly realized that I need to wait after a project deadline and paused download almost immediately after. I went back a few days later and the pause button is gray with the text "pending" next t
-
Where can I download the source code of the kernel for Iconia A1-830?
Global - download.acer.com I can only find the source code of the kernel for A1 - 810 and 811 - A1, but for A1-830 the source code isn't there.
-
Installation of Linux on a XPS 8500
Dear Dell, I just replaced my old Dell Dimension with a new 8500 XPS at great expense. On my old size, I was able to load Linux on a completely separate drive. When I tried to boot into Linux, I was able to change the boot priority and start Linux. H
-
Hello, I have 3 U2414H... I like to connect in channel/STI... But I have read that many people have had problems. So, I am writing to know if something has been resolved or not. Thank you.
-
BPEL - Skipping foreach shows "pending."
HelloI put a condition of BPEL jump on a foreach activity. I've specified that if the number of a table is zero, for the activity. The activity is indicated as ignored in the audit trail, but it shows as pending. Here is a picture of how it appears i