Consider that we have the models A , B , C and D , each referencing the previous one, ie A has many B s, B has many C if C has many D s:
No redundancy
A
| id | ... |
------...
What information should be stored?
Is it a good practice to use TRIGGER in the database to store logs or via code is something safer and easier to maintain?
I need to get a record of a table, where this record is what the date was entered last.
Of the genre:
SELECT Ped.Quantidade
FROM ped
WHERE data <= @data
But as I have several records it returns me all, when I just want the last one in...
I need to modify a part in the text of a table. The records for an email are [email protected] and need to change all to jf.jus.br . Only the first part of the email does not change (the xxx).
I can do one
update
TABELA
set
email = RE...
Well, the question is this. I have a database that has the purpose of making the cash book of a company, basically this bank has a CaixaCorrido table with columns Id , PessoaNome , DataHora , Descricao , Valor...
I am a beginner in Sql server, I am doubtful about the following code:
declare @var nvarchar(50) = null
declare @bool bit
if (@var = null)
set @bool = 1
else
set @bool = 0
print @bool
The variable @bool returns as 0...
I have a table with the following columns:
id - manager_id - value - source - source_id
By registering an "Account to Pay", I enter in this table the company's management breakdowns. Assuming that it would have to pay a certain vendor the...
How to make a count of records that a query would return in Linq (Entity Framework) in C #? The equivalent in SQL is to make a SELECT COUNT(*) .
Note that I want to receive the direct count of records, just like a SELECT COUNT (*) would...
I have the following search:
SELECT * FROM ('agendamentos')
WHERE 'age_data_agendado_para' BETWEEN "2016-08-28" and "2016-08-30"
In the database, I have:
But on my return, I can only search for two records, as print_r ():
Arra...
I was using the following code in mysql:
delete from aluno where id=(select MAX(id) from aluno);
But the following error appears:
Error Code: 1093. You can not specify target table 'student' for update in FROM clause.