sql

Creating and deleting a table manually in Hibernate using sql queries

You must manually create and delete a table in the database using sql queries using Hibernate. Class-the entity that the tabl ... esn't help, it's just that the table is no longer created automatically. How do I make the methods work, what did I do wrong?

INSTR function. Translation from Oracle to Postgres

There is such a request for Oracle (SQL Developer): SELECT MAX (COMM.CREATION_DATE) mcd, SUBSTR (SOURCEUUID, INSTR (SOURCEU ... how to make a similar request for Postgres? The request itself returns: a date in the DD.MM format.YY time and some number.

The result of the SYS CONTEXT function with the BG JOB ID parameter differs from the previous versions

In the Oracle DB releases prior to 19c, the SYS_CONTEXT('USERENV','BG_JOB_ID') function returned the job ID (column user_job ... ried to link through the views v$Scheduler_Running_Jobs and dba_jobs_running. You can do this, but I'm not sure what's right.

What is the alternative to REGEXP REPLACE for creating a functional index?

After migrating to Oracle 18c Enterprise Edition, creating a functional index (FBI) fails. This is what DDLs look like for c ... c? If such a feature is no longer supported for the FBI, what other way is there to provide such functionality for the index?

Transposing a table (rows to columns)

Which query can transpose a table (rows will become columns)? Moreover, without using the pivot function.

Not a GROUP BY expression SQL Oracle

Tell me why GROUP BY returns the error not a GROUP BY expression WITH LNK AS (SELECT ART.ITEM_OLD, ART.ITEM_NEW, ART.Format ... PA.Planship>0 GROUP BY PA.Item,PA.Loc Everything works. And when I collect the entire query - not a Group By expression

Explain how the decimal(n,n2) data type works)

What do the parameters n and n2 mean ? I need to store the cash balance in the db

Error when writing to the database:SQL error or missing database (no such column:…)

There are columns, there are no records in the database. Compilation error: org.sqlite.SQLiteException: [SQLITE_ERROR ... ogger.getLogger(contactQuery.class.getName()).log(Level.SEVERE,null,ex); } return ContactIsCreated; } }

SQL query-IF(EXISTS ()) construct in MS Access

I connect to MS Acess via VBA (ADODB. Connection). The SQL query returns an error. The design is as follows: IF(EXISTS (SELE ... блицы, где ищется запись) VALUES() END UPDATE works separately, but not in the IF(EXISTS ()) construct.

Does a deterministic function make sense here?

The request uses the following condition: t1.field = replace(t2.field, <Сложная конструкия вычислений по тексту, insrt, su ... ular case? And another passing question, is it possible to somehow find out which options are already contained in the keshe?

Advantages of FORALL vs INSERT

Some parts of the package use insert into select from, and some parts use insert into select from.- bulk collect + forall ins ... view, does one of these methods have an advantage in speed or other aspects of execution, or are they completely equivalent?

Comparison of the implementation of transaction management models in Oracle and SQL Server DBMS

The question was voiced in the title. Independently found only that a different number of isolation levels, in SQL Server 4 + 2 dop, in Oracle 3, it seems to be insufficient.

Aggregating functions in SQL queries

Good afternoon. In the MS SQL Server 2008 database, you need to run a query that contains the COUNT() function and filters b ... газин') ORDER BY SR Returns an error, because Chanel is not contained in GROUP BY. How to get the required data using SQL?

Aggregate function Count () in a query with multiple tables

There are two tables. The first table Reader contains information about the library's readers. Table fields: LibraryCardNum ... possible to somehow formalize a request so that both the quantity is calculated and the fields from another table are output?

How to implement polymorphic relationships in sql?

Can you describe in detail the sql code for creating polymorphic relationships? For example, let there be 4 tables: Students, ... where the first column is the id from any linked table, and the second is the name of the table from which this id is taken.

The all statement in sql does not work as expected

You need to create a query that displays the names of managers whose subordinates all receive more than $2500 Here is my solu ... ,60) ; INSERT INTO Emp VALUES (8003,'DR NO','ANALYST', 7839, TO_DATE('2011-09-11', 'YYYY-MM-DD'), 2500,null,null) ; commit

Window functions and GROUP BY in a single request

There is the following code: SELECT PT."date", MAX(COUNT(PT.TRIP_NO)) OVER () MAXC FROM PASS_IN_TRIP PT JOIN T ... Guess: the reason is that the window is taken at the very end, after applying grouping and filtering by HAVING. Is that so?

How do I view the entire contents of a. sql file in 1GB?

How do I view the entire contents of a. sql file in 1GB? Any browsers and text editors hang.

How do I return values from a MySQL stored procedure?

I started learning MySQL after 20 years of working with SQL Server. 95% of my database queries are stored procedure calls, wh ... ything is clear. The syntax is no different from Transact-SQL. I would appreciate more elegant solutions (if there are any).

Books, manuals on SQL; Oracle, MySQL [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... not complete, scattered. Therefore, I ask for your advice, as people who know and have already passed this stage. Thank you