I'm trying to start a MySQL database connection and it works, but when I request that PHP display what it has there nothing appears. It's as if the connection to the BD had failed.
<?php
// definições de host, database, usuário e senha
$s...
I wonder if there is any way to calculate the difference between values that are in the same column. For example: I have a table with 2 fields: date and balance. I need to add a new field containing the balance difference from one date to anothe...
I have a question. I think it's not very complex, but I could not solve it.
For example, I have this query:
select * from Paciente where ClinicaID = 3
Your result would be these 3 records:
NomePaciente HoraAtendimento Ativo Clinica...
I need to do a SQL query to count indications, I have the following querys :
SELECT 'FACEBOOK', COUNT(id) FROM 'clientes' where indicacao like '%face%'
SELECT 'Instagram', COUNT(id) FROM 'clientes' where indicacao like '%insta%'
SELECT 'go...
I need to sample all the tables in a MySQL database, for example through SELECT * ... LIMIT 10 .
I already have the code that returns all the tables in the current database:
select table_name from information_schema.tables where table...
I'm creating this trigger in SQL Server , but I'm not getting the id to send the data to another table and delete this table.
CREATE TRIGGER MoveComprador
ON comprador
INSTEAD OF DELETE
AS
BEGIN
SELECT * INTO bk_comprador FROM...
Good morning guys, I'd like to know how to do the following SELECT in mysql:
Having the following table, I need to select the last 3 purchase of each Name:
From now on, thanks
I am developing a new project and I am creating a system of profile followers, in which the purpose is to show only the publications of whom I follow.
Like for example the one of a social network.
I follow the person, so I get the person's publ...
During the development of some queries in the database, I come across the situation of the need to perform a new query, but another solution in some cases may be the subquery.
So what is the best solution to perform a second query or use subq...
I'm using Zend and I have the following function:
public function getChamado($id) {
try {
$cols = array(
'id', 'titulo', 'descricao', 'fk_status', 'fk_local',
'fk_tipo', 'created', 'modified', 'finished', 'fk_usuario',...