Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
On Oracle, how can I list ALL tables and ALL materialized views without indexes using a SELECT command ?
Well, normally I wouldn't do this, but here you go:
SELECT t.TABLE_NAME
FROM USER_TABLES t
LEFT OUTER JOIN (SELECT DISTINCT TABLE_NAME
FROM USER_INDEXES) i
ON i.TABLE_NAME = t.TABLE_NAME
WHERE i.TABLE_NAME IS NULL;
Perhaps your question should be "Why did someone just do my homework for me?".
Best of luck.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am wondering whether I can create a column with dollar sign? The output should look like the area marked by red line. But the column can still be calculated like number.
I am not sure whether it is capable.
You can try this:
select to_char(500, '$999') from dual
Column-Name with Dollar:
CREATE TABLE t1 (ID int, "$Sal" int);
INSERT INTO t1 values(1,100);
SELECT id, "$Sal" * 10 FROM t1;
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
DECLARE
CURSOR c_CUR IS
SELECT id, table_name, is_deleted FROM truncate_table WHERE IS_DELETED=1
ORDER BY id DESC;
BEGIN
FOR C IN c_CUR LOOP
EXECUTE IMMEDIATE 'TRUNCATE TABLE'|| C.table_name;
END LOOP;
END;
I HAVE AN ERROR TABLE OR CLUSTER KEYWORD IS MISSING
It is very clear that you are not creating a dynamic query properly. Space is missing between TABLE'|| C.table_name
It must be something like this:
EXECUTE IMMEDIATE 'TRUNCATE TABLE '|| C.table_name; -- see space after TABLE
Cheers!!
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I have two tables
TABLE1
-DATADATE
-ISIN
-INDEXNAME
TABLE2
-AS_OF_DATE
-ISSUER_ISIN
-GPSCORE
-SPSCORE
I would like to merge the two tables by matching on:
AS_OF_DATE = DATADATE
and
ISIN = ISSUER_ISIN
Try this one:
SELECT * FROM TABLE1 tb1
INNER JOIN TABLE2 tb2
ON tb1.DATADATE = tb2.AS_OF_DATE
AND tb1.ISIN = tb2.ISSUER_ISIN
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have an existing table. I have a select query which might return multiple rows. I want to display all rows that this select query returns, without using cursor. How can I achieve it in pl sql?
If I understand your question correctly, the following is a possible solution:
BEGIN
FOR T IN (SELECT 'data_1' col_1,
'data_2' col_2,
'data_3' col_3
FROM dual) LOOP
dbms_output.put_line('Query returns: '||T.col_1||', '||T.col_2||', '||T.col_3);
END LOOP;
END;
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have something like this :
Select id , name from table1 (how to orderby alphabetical from the name(column))
the result from select should be :
1.Alex
2.Bob
3.Charlie
Use this:-
Select id , name from table1 ORDER BY NAME
By default, the order is ascending. If you want to get the names in the descending order use:-
ORDER BY NAME DESC