Suppose I have a table like this:
item | group
-------+--------
item a | group x
item b | group y
item c | group y
item d | group x
item e | group z
And I want to select a single item to represent each group.
Now, you should be thinkin...
I am setting up a system that finds providers in a specific region, calculates the average amount charged by them and brings this value.
But before that he will only pick up the providers that are available on the requested date. I have these...
I'm having trouble creating the foreign key in migration.
I'm working with PHP, LARAVEL 5.3 and MYSQL.
You are giving me the following error:
Below is my code:
Table Migration of the categs
class CreateCategsTable extends Migr...
I need a Query that returns 2 columns added (input and output) from the "accounting" column of the "tbl_sef" table. The value of the "accounting" column will be in the "input" column when the "cfop" column is less than 5000. And it will be in th...
I have tabela_x , where the first field ( campo1 ) is primary key and autoincrement .
I make a simple INSERT :
$ins = " INSERT INTO tabela_x ('campo2','campo3','campo4') VALUES ($c2, $c3, $c4) ";
$con -> qu...
I'm having trouble saving images to a form. Does anyone know how to save image to mysql database using spring boot? I am now learning this technology, so with this difficulty.
Form html:
Providers
Suppli...
I have a foreach that fetches the data from one table and makes a insert in another table. I need to count the number of foreach registers, and then generate a random sequence, and feed a insert field.
See the code...
How do I create XML tags with the column names of a table from a myslq query?
In the code I made I just get the values from each cell in the table, but what I wanted was to automatically create the tags according to each column.
My Curren...
Let's suppose a website with a relatively high flow rate. A user X inserts a record into the database at the same time as another user Y inserts another record.
Considering that the procedure of this insertion of user data X and user Y is:...
I'm trying to join tables and add a chave estrangeira , so that for example, a purchase table has referência of id of the buyers table.
I did as follows:
alter table compras add foreign key (compradores_id) references co...