sql

Working with SQL dates

Hi everyone.No one can tell you how to take the timestamp of the beginning of the current week ? (T-SQL)

Updating the database after the time has elapsed

Good time of day. There is a table in the database. You need to update it every two hours. We write the time in the table, in ... ult matches the conditions, then UPDATE, not so no. Q: How do I compare two dates? Format, for example, (10:21:32 /hh:mm:ss).

How to make a conclusion from sql?

There are 3 tables, Output the last 10 comments from the database and output information about the author. Output the last ... id = '".$_GET[news_id]."' ORDER BY post_id DESC LIMIT 80 You need to have all of this in 1 request - not requests in a loop.

Adding an entry to a table with a condition

Help with the request in the procedure. The bottom line is that there is a procedure that adds the product. And by id and you ... this way If select count(*) from ProductTable where ProductTable.Id = @id >0 // то добавляем. But something is wrong

SQL injection of the form on the site

Hello everyone, I got the task to write a simple form of registration and authorization on the site, I successfully coped, no ... submit" name="close" value="Выйти" class="btn"> </form> </div> </body> </html>

Error with any DML query to the table - ORA-00942 Table or View Does Not Exist

Once upon a time there was a Bar table in the Foo schema. Long lived in the production database, it did not have many lines, ... SQL> The DDL request to add a new column and delete it passes without errors. Restarting the instance didn't help

Write 2 sql queries

1.What is the percentage of orders with a discount? 2. What is the most popular discount (name) and what is the total cost of ... Database are given: 1.orders (id, disc_id) 2.discounts (id, name, count) Name-name of the discount count-discount in rubles

Why use a semicolon at the end of a query to protect against sql injections?

One friend said that at the end of the sql query when working (in php in my case), you need to put a semicolon to protect aga ... . But... Tell me in what case it might help if I substituted the parameters directly into the string? I can't understand it.

Sql server array of type long, int

In the sql server dbms table field, you need to organize an int or long array. How do I do this?

Double SQL grouping

There is a request SELECT Token, COUNT(Token) as OPEN FROM srvLogCmd WHERE DATE(DateTimeB) BETWEEN ' ... 2 | | 2 | 2 | | 3 | 1 | +------+---------------------------+ Etc

Reusing the CTE in the same query

In my c# code, dapper executes a query of the following type: const string query = @" ; WITH copp AS ( ) SE ... unds? I'm sitting here thinking about whether to issue a cte with a view, but maybe there are some options to do without it?

How to transfer data from excel to sql?

How to transfer data from excel to sql?

Similar to LIKE (substring search) in LINQ

How do I redo this query to have something like WHERE movie.Title LIKE "searchString" That is, searching for a substring, ... in db.Movie where movie.Title == searchString select movie; return View(MovieQuery); }

SQL. Search the text of one cell to match the text from another cell

There are two tables Transactions and Users. Please tell me how to make a search in the Transactions.Details field by menti ... )% characters, the error [14:07:02] Ошибка при выполнении SQL запроса к базе данных 'test_wallets': near "%": syntax error

The sequence of conditions in Sql Server

Which of these queries is more correct and why? -- Первый запрос select * from table1 t1 join table2 t2 on t2.id = t1.id whe ... pplied to the remaining part of the table. When building queries with join, using where is mandatory? P.S. Sql Server 2012.

Database manipulation (sqlite, mysql) via C++

I'm trying to find a way to create/edit/delete a database (sqlite, mysql) from the C++program code. At the moment, I want to ... Who has any thoughts? UPD: I was prompted to work within QT. Can anyone know about the problem when working within pure C++?

Should I use a database or storage for images?

Hello everyone I'm starting to plan the architecture of a web application, and I have a question about storing images. In th ... ase, which one to choose? I don't have an answer to the question of how many images there will be, but I have a lot of plans.

Incorrect syntax near the ON-SQL keyword

There is the following query (actually it is bigger, but I have shortened it): INSERT INTO DBName.[ТСГрафик] ... the message "Incorrect syntax near the ON keyword". You need to do a massive Update. Tell me what is wrong with the request?

Count the number of records for 2018 SQL

Hello everyone, I ran into a small problem. There are related tables, the data from them I got, but I need to count the recor ... nce the date is in full format, it counts only one record at a time. I need an output of type 2018 | 4. How do I do this?

psql: error: could not connect to server: could not connect to server: No such file or directory

postgres@vosmottor-H370M-DS3H:~$ psql psql: error: could not connect to server: could not connect to server: No such file or ... cket "/var/run/postgresql/.s.PGSQL.5432"? I put it like this: sudo apt install postgresql postgresql-contrib How to fix it?