Questions tagged [SQL] (4020)

3
answers

To track changes to specific fields in your database, perhaps?

There is a table in the database, is there a way to track what has varied particular field and only it! Let's say we have a table with fields name, phone, city. Need to keep track of the city box. If changing the name or the phone, not the event, but if changing the box city event is and it need to track? As it is possible ...
Melisa.Reilly asked April 19th 20 at 12:41
4
answers

As in PostgreSql to gruppirovanie for null/not_null?

There is then a field, columnName, which can contain either NULL, or some random string. If you write a normal "GROUP BY columnName", then the sample are grouped by each value of columnName that there is almost unique and the meaning of such groupings there. I would like to divide the sample into 2 parts: one where the fiel...
Robert.Schuppe asked April 19th 20 at 12:26
2
answers

Can't figure out how to calculate the departures, which follow each other with an interval of not less than 5 minutes?

There is a table of flight from which to choose, the number of flights, which follow EACH other with an interval of not less than 5 minutes. The airport of departure departure_airport should be equal to the SVO. I don't understand how you can use the string comparing them with other strings, to the time of departure diff...
Lowell_Prosac asked April 19th 20 at 12:11
1
answer

Why CONCAT with aggregation functions returns the BLOB?

Good time of day. Solve the problem using aggregate functions: But when trying to connect the string via CONCAT returns BLOB value. When I use aggregate functions without the concatenation, the result is output stable. I made a mistake, and how to connect them? Query: SELECT CASE WHEN DAYOFWEEK(BIRTHDAY) = 1 THEN 'Sunday'...
frederique_Batz84 asked April 18th 20 at 13:31
1
answer

How to convert query from t-sql to oracle sql?

Hello! There are two tables: Need to get a list of sellers and the number of orders that have the maximum number of goods sold. T-sql implements the query: select top(1) with ties s.Name , sum(isnull(o.Amount, 0)) as Quantity from Sellers as s inner join Orders as o on s.id = o.Salesperson_id where o.Order_date is ...
Ana_Ba asked April 18th 20 at 13:07
2
answers

Is it possible to maintain the consistency of the output fields?

All kind time of day. My goal is to bring the number of employees, as in the table below: I wrote the query but the fields that do not fit under any of the conditions are not displayed at all. It can be concluded each field, but if no records found, then displays the value 0? And the second question. Is it possible to main...
Maryam.Lueilwitz39 asked April 18th 20 at 12:54
1
answer

How to make a dB connection on another PC?

connect local database on my PC everything works, the other does not work although the file path is automatically set swears it is on the dB connection. "************ Exception Text ************** System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a co...
Nikko asked April 18th 20 at 12:54
2
answers

What you need to know to create the query?

Hello! Is the SQL code: create table D_TEST ( id number(17), numb number(10) ) alter table D_TEST PK_D_TEST add constraint primary key (ID); alter table D_TEST UK_D_TEST_N add constraint unique (NUMB); I need a single query to loose a minimum (absent) number (NUMB), but not less than the minimum employed (existing) ro...
rahul92 asked April 18th 20 at 12:54
1
answer

Will help you to write two queries Inner Join?

Hello! Help to solve a SQL job: There are two tables: 1. You should print the names of all the sellers that have more than 1 order, beginning in 2010. 2. Display a list of sellers and the number of orders that have the maximum number of goods sold. There is need to use Inner Join?
Asia73 asked April 18th 20 at 12:49
2
answers

You can choose the nearest entry for a given date?

There is a table (with fields id, datetime, sum). Stored date in the format YYYY-m-d H:i:s In this table many records. We have the desired sum, we must choose the desired date. Need to get one to the nearest value on the date (in both directions) containing the desired sum. Is it possible to rotate by means of the database...
Alexandrine91 asked April 18th 20 at 12:46