Click here to Skip to main content
15,122,354 members
Home / Discussions / Database
   

Database

 
AnswerRe: A strange issue!The count of queries does not match data. Pin
Maciej Los17-Apr-19 0:34
mveMaciej Los17-Apr-19 0:34 
SuggestionRe: A strange issue!The count of queries does not match data. Pin
Richard Deeming17-Apr-19 2:16
mveRichard Deeming17-Apr-19 2:16 
GeneralRe: A strange issue!The count of queries does not match data. Pin
Member 1409322317-Apr-19 16:27
MemberMember 1409322317-Apr-19 16:27 
GeneralFavour sought from a MySql expert Pin
Ger Hayden16-Apr-19 22:50
MemberGer Hayden16-Apr-19 22:50 
GeneralRe: Favour sought from a MySql expert Pin
Richard MacCutchan16-Apr-19 23:21
mveRichard MacCutchan16-Apr-19 23:21 
GeneralRe: Favour sought from a MySql expert Pin
Ger Hayden16-Apr-19 23:34
MemberGer Hayden16-Apr-19 23:34 
GeneralRe: Favour sought from a MySql expert Pin
Richard MacCutchan16-Apr-19 23:48
mveRichard MacCutchan16-Apr-19 23:48 
QuestionSQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Member 1422994312-Apr-19 23:35
MemberMember 1422994312-Apr-19 23:35 
I am trying retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql with query below.. however I am encountering below.. unable to find the missing paranethesis


select owner, table_name, column_name,
to_number(xmlquery('/ROWSET/ROW/C/text()'
passing xmltype(dbms_xmlgen.getxml(
'select count(distinct "' || column_name || '") as c '
|| 'from "' || owner || '"."' || table_name || '"'))
returning content)) as distinct_count,
to_number(xmlquery('/ROWSET/ROW/C/text()'
passing xmltype(dbms_xmlgen.getxml(
'select count(case when (' || column_name || ' = ' ' ) then 0 end) as c '
|| 'from "' || owner || '"."' || table_name || '"'))
returning content)) as null_count,
to_number(xmlquery('/ROWSET/ROW/C/text()'
passing xmltype(dbms_xmlgen.getxml(
'select count(case when "' || column_name || '" is not null then 1 end) as c '
|| 'from "' || owner || '"."' || table_name || '"'))
returning content)) as notnull_count
from all_tab_columns
where owner = 'JAMES'
and table_name = 'TEST'
and data_type in ('NUMBER', 'DATE', 'TIMESTAMP', 'CHAR', 'VARCHAR2',
'NCHAR', 'NVARCHAR2');

ORA-00907: missing right parenthesis
00907. 00000 -  "missing right parenthesis"
*Cause:    
*Action:
Error at Line: 9 Column: 58


Please can u help
AnswerRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Richard MacCutchan13-Apr-19 0:26
mveRichard MacCutchan13-Apr-19 0:26 
GeneralRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Member 1422994313-Apr-19 1:40
MemberMember 1422994313-Apr-19 1:40 
GeneralRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Richard MacCutchan13-Apr-19 2:07
mveRichard MacCutchan13-Apr-19 2:07 
QuestionLinkedServer version Pin
Darrylw9912-Apr-19 5:59
MemberDarrylw9912-Apr-19 5:59 
AnswerRe: LinkedServer version Pin
Mycroft Holmes12-Apr-19 13:43
professionalMycroft Holmes12-Apr-19 13:43 
QuestionSQL Interview Pin
Member 1417944312-Apr-19 4:38
MemberMember 1417944312-Apr-19 4:38 
AnswerRe: SQL Interview Pin
Richard MacCutchan12-Apr-19 7:34
mveRichard MacCutchan12-Apr-19 7:34 
GeneralRe: SQL Interview Pin
Member 1417944312-Apr-19 23:36
MemberMember 1417944312-Apr-19 23:36 
GeneralRe: SQL Interview Pin
Richard MacCutchan13-Apr-19 0:20
mveRichard MacCutchan13-Apr-19 0:20 
GeneralRe: SQL Interview Pin
Eddy Vluggen16-Apr-19 3:54
professionalEddy Vluggen16-Apr-19 3:54 
AnswerRe: SQL Interview Pin
#realJSOP16-Apr-19 3:00
mva#realJSOP16-Apr-19 3:00 
QuestionQuerying from multiple tables at the same time - related to correlated subqueries Pin
User 141845817-Apr-19 6:12
MemberUser 141845817-Apr-19 6:12 
AnswerRe: Querying from multiple tables at the same time - related to correlated subqueries Pin
Mycroft Holmes7-Apr-19 13:08
professionalMycroft Holmes7-Apr-19 13:08 
AnswerRe: Querying from multiple tables at the same time - related to correlated subqueries Pin
Eddy Vluggen8-Apr-19 1:44
professionalEddy Vluggen8-Apr-19 1:44 
AnswerRe: Querying from multiple tables at the same time - related to correlated subqueries Pin
CHill6011-Apr-19 7:48
mveCHill6011-Apr-19 7:48 
QuestionHELP WITH SQL QUERY Pin
BrunoPigeon4-Apr-19 18:37
MemberBrunoPigeon4-Apr-19 18:37 
AnswerRe: HELP WITH SQL QUERY Pin
Mycroft Holmes4-Apr-19 21:38
professionalMycroft Holmes4-Apr-19 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.