Create an ORACLE data dictionary of tables with more than 2 indexes [closed] - sql

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm having trouble trying to figure out in an ORACLE data dictionary whether a table has more than 2 indexes.

You can start by looking at a dictionary table such as ALL_INDEXES and trying something like this:
SELECT TABLE_NAME
FROM USER_INDEXES
GROUP BY TABLE_NAME
HAVING COUNT(*) > 2;
I haven't tried the code, or read the doc in detail to see if there may be cases where things show up twice, but it should put you on the track.

Related

A newbie in SQL asking about functions [closed]

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 6 months ago.
Improve this question
How can I find data that dont end with letter 'g' without using NOT LIKE function, please help
select * from table where right(column, 1) != 'g'
Since you asked how to do it using "not like," I'll answer that. The function version provided by #Zoories would be more efficient.
This works at w3schools.com
SELECT * FROM Customers where CustomerName not like '%g';

How to use LIKE operator on a subquery(returning multiple values) inSQL Server [closed]

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
SELECT *
FROM Products
WHERE Industry IN (SELECT *
FROM STRING_SPLIT('Logistics;Retail;Agriculture', ';'))
Can I use LIKE instead of IN in my WHERE clause?
You could use LIKE as follows:
SELECT *
FROM Products
WHERE ';Logistics;Retail;Agriculture;' LIKE '%;' + Industry + ';%';
But it would be better to see if you can use a WHERE IN (...) construct, which would be sargable, easier to handle, and probably more performant than the above.

regexp_like vs like operator : Oracle [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am searching for multiple phrases using SQL 'like' operator. Same results can be extracted using Regexp_like function in Oracle. Which one is better/efficient to use and why? My observation is that 'like' works much quicker than regEX.
I am running my queries against very large dataset with few million rows.
Here are both the versions of the query
Using like:
select
name
from
table
where
lower(result) like '%the condition is absent%'
or lower(result) like '%partial presence of disease%'
Using Regexp_like():
select
name
from
table
where
regexp_like(lower(result),'^.*(the condition is absent)|(partial presence of disease).*$')

Sql code to create the Mirror image of the string in Oracle sql [closed]

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 7 years ago.
Improve this question
Team,
I need a sql query or function which will create the mirror image of string.
Thanks
Rajeev
If "mirror" is reversed text use:
SELECT REVERSE('my_text') FROM dual;
EDIT:
SqlFiddleDemo
SELECT t
,REVERSE(t) AS Mirror1
,TRANSLATE(t, 'abcdefghijklmnopqrstuvwxyz',N'ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz') AS Mirror2
,TRANSLATE(REVERSE(t), 'abcdefghijklmnopqrstuvwxyz',N'ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz') AS Mirror3
FROM tab;

Access 2010 SQL Update Query [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I need to update every row in one table, with the help with two subqueries...
UPDATE MyTable
SET MyTable.ColumnToUpdate =
((SELECT 10000 / DCount("ID","MyTable")) * DCount("ID","MyTable","ID<="& MyTable.ID))
But this doesn't work, access complanis about an error in the first subquery...
How can i do this?
Thanks
You don't need the SELECT statement in the first piece. Try this:
UPDATE MyTable
SET MyTable.ColumnToUpdate =
((10000 / DCount("ID","MyTable")) * DCount("ID","MyTable","ID<="& MyTable.ID))