Számított összegek a mezőnevek mellett:

select a.*, ar+ afa  as osszeg from tabla a WHERE a.datum like ‘20161120’;

Group by-os példa:

select count(*), substr(datum, 1,6) from tabla where folyoszamla = ‘12345’ group by (substr(datum, 1,6))

 

data_dictionary, nézegesd, fontos infok vannak benne.

Findig tables containing a column – original article here

SELECT table_name
  FROM user_tab_cols
 WHERE column_name = 'IS_REVIEW_APPEALS'

See below query for how to get all columns with the given name for a specific schema in Oracle:

SELECT 
    t.owner AS schema_name,
    t.table_name, 
    c.column_name
FROM sys.all_tables t 
    INNER JOIN sys.all_tab_columns c ON t.table_name = c.table_name
WHERE LOWER(t.owner) = LOWER('MySchemaNameHere')
    AND LOWER(c.column_name) LIKE LOWER('%MyColumnNameHere%')
ORDER BY t.owner, t.table_name, c.column_name;
Simple table finder:

SELECT
t.owner AS schema_name,
t.table_name
FROM sys.all_tables t
where lower(t.table_name) = ‘wanted_table’

 


Egy mező többszöri előfordulásának megkeresése:

select adosz, count(adosz) from TABLA group by adosz having count(adosz) > 1;

 

Szekvenciák lekérdezése: select * from user_sequences

Triggerek: select * from user_triggers

Tábla másolása benne lévő adatokkal:

create table xyz_new as select * from xyz;

Tábla másolása, csak a struktúra:

Just use a where clause that won’t select any rows:

create table xyz_new as select * from xyz where 1=0;