sql

Error Notice: Use of undefined constant

In the loop, the following function is executed twice in a row: function CodeToURLImg($code) { $sql_catalog = 'SELECT Im ... etcat/full.php(127) : eval()'d code on line 121 Both times, the same value was passed to the function. How do I fix this?

MySQL: INSERT... VALUES, INSERT... SET and hybrid version

When reading the legacy code, I found an SQL query to MySQL of this type: INSERT INTO table (field1, field2, field3) V ... just redundant code that can be cleaned up and brought to either the standard variant (1) or the MySQL-specific variant (2)?

Cross query sql php

Can you please tell me how to display on the page in the table not the id, which is in the database, but the value itself, wh ... ators` WHERE data_id_station = '".$_GET['id']."' Can you tell me how to correctly output the data, and not the id? Base:

Testing the MSSQL database

Good afternoon! Are there any tools for automated database testing on MSSQL? For example, projects for Visual Studio (the templates of which I did not find in the studio itself)? Share your experience and links. Thank you in advance.

A nested SQL query with three tables

There are three tables: Orders, information about the service (service) and the performer (employee). Employees, informa ... ORDER BY Employees.employee_name; ) AS B; WHERE B.sum > AVG(B.sum); ORDER BY Employees.employee_name;

Data normalization

The task is to normalize (0-1) the order stack in stock trading. In the glass, I can only see the 25 best price offers, i.e. ... base for normalization? And if so, how?(Orders are quickly canceled/appear and it is not clear what data should be recorded)

How does the RECORD type work in a PostgreSQL trigger function?

I need to log postgre tables whose records do not have timestamps, so that I can get statistics on them in the future. I solv ... in the same order as the columns of the table. The question is, will the order always match, or are these some special cases?

Deleting data from multiple linked tables

There are three tables linked one-to-one by ID. I need to delete all records from three tables that satisfy the condition: A. ... D LOOP; COMMIT; END; There is a lot of data and so it works for a very long time. Is there any way to make it faster?

How do I give the MS SQL database role the right to create and modify tables and other objects?

Hello everyone There was such a problem: there is a database with such a scheme: You need to create 3 roles: Full access ... as well as built-in functions and triggers through the database roles. SQL Server Version 13.0.5026.0 2016 Developer Edition

Fill an SQL table with data from another table

There are 2 tables: "PS" "S" How do I fill in the "UserId" column in the "S" table based on the data from the "PS" table? I ... "userID" so that "PS"." SubscriptionId " = "S". "id". You must actually fill in the table " S " The result I want to get:

How do I install only SQL * Plus on Windows?

There is a machine with Windows XP. As far as I know, you can install the SQL Plus console without Oracle SQL Developer and without Oracle at all on the machine. How do I do this?

Code First approach, how to build a table correctly

I use the Code First approach, I want to make a simple model of an online store. I want to use the Product, Client, Order ent ... cts { get; set; } public DbSet<Client> clients { get; set; } public DbSet<Order> orders { get; set; } }

Automatic partitioning of MSSQL 2012 tables

There are two tables Tab1 | id | time | Tab2 | id | id_tab1 | value | You need to partition both tables, in the first table ... tially, only the section in which I will change the ranking range will change, or will the entire table be partitioned again?

I can't understand what the Error Code: 1005 is related to. Can't create table (errno: 150 "Foreign key constraint is incorrectly formed")

CREATE TABLE IF NOT EXISTS `book_shop`.`Book` ( `ISBN_BOOK` VARCHAR(20) NOT NULL, `YEAR_BOOK` YEAR NULL, `TITLE_BOOK` VARCHAR ... de: 1005. Can't create table book_shop.shoppingbaskets_have_books (errno: 150 "Foreign key constraint is incorrectly formed")

How do I define a column with the BLOB data type in a private temporary table (PTT)?

When writing various procedures, I ran into the problem that when I try to define a column with the data type BLOB in a priva ... ors, it works like this. Free translation How to define BLOB column in Private Temporary Table? from member @Gregor Cerinšek

SQL query to the bookstore database

There is a database with two tables. The first table shows information about the books. The second table contains a list of b ... will output a list of all publishers and for each publisher will output the book name of that publisher with the most pages.

Is it possible in Oracle to undo the changes made after Commit

The question is theoretical, if during the session in the Oracle database I made a transaction, such as insert or update, and ... . Can I return everything to its original state, such as Undo or Rolback. I would like to know the opinion of Oracle experts.

Complex sql query consisting of two tables

Table 1roller id | type_roller | name_file | filepath | time_start | time_stop | period | user_id | tc_servers | timeRolik Ta ... oller_priority user_id == user_id id == roller_id Based on this, glue the priority column to Table 1 and sort Table 1 by it.

Java-SQL procedure

Hi everyone. You need to get the ResultSet from such a procedure: exec ais_disp.p_lk.p_add_client (v_sis_id => 1640, ... ommit; How to cram this into java code? I tried using CallableStatement, but I can't insert select from the procedure there.

Question on sql, is it possible to do this with a single SELECT query?

User Table: users ---------- `id` int(11) `email` varchar(55) `login` varchar(55) And the order table orders -------- `id` i ... to display a list of login's-users who have made more than two orders. is it possible to do this with a single SELECT query ?