Questions tagged as 'sql'

3
answers

How to join 3 Select in one

I would like to know how I could make a SELECT where I can bring the same but result in a single SELECT . Select example I need to be unique: SELECT COUNT(*) AS QtdTarifados FROM tblLoteTESTE WHERE CodCampanha = 1...
asked by 12.07.2018 / 15:03
2
answers

Selection with various conditions of differences (SQLSERVER)

I wonder if there is any way to improve this selection: SELECT * FROM table WHERE id <> 15 AND id <> 17 AND id <> 23 ... id <> N I do not have a certain interval defined and the ids are selected by the checkbo...
asked by 09.10.2017 / 15:53
3
answers

Select date with Between in Varchar format

I am redoing the question because I did not get the desired result, I would like to do a select in the date field but the between is not working, I believe it is due to my date field being in VARCHAR format, I tested the code below: ("SELECT *...
asked by 05.10.2017 / 18:58
2
answers

Return last record from table

I'm trying to make a method that returns the last record of the table but gives error:    "Coditem" operation failed public int UltimoItem() { con = conexao.obterConexao(); try { cmd = new SqlComm...
asked by 04.10.2017 / 21:48
2
answers

Error Backing Up Windows Forms Database

I have problems with this problem! My application is in Windows Forms. I need to back up the data through the application itself, but when I run to perform it it informs me of this error. https://i.stack.imgur.com/e5cq8.jpg "> Note: My backu...
asked by 21.06.2018 / 18:04
2
answers

PHP + SQL UPDATE PROBLEM

Good morning personal dawn. I am doing a simple quiz for my web class and am having a problem to do an update in SQL via PHP. The database is configured correctly, select works but the update is inert to the system. No error message and not work...
asked by 10.04.2015 / 03:54
1
answer

Save time to register in the database

I have a form and whenever someone registers, I need to save the time of the registration in my table Historico2 within the property DateTime? Quando . public partial class Historico2 { public int ID { get; set; } [Required]...
asked by 25.02.2018 / 21:50
2
answers

Division in sqlserver

I'm using SQL Server 2008, I'd like to split 50/100 for example and return me 0.05. But it returns me 0, it follows what I tried to do:     
asked by 29.10.2018 / 21:24
2
answers

MySQL query using JOIN

Hello! I have the following database: I would like to make an appointment where I can search for example the teacher x that is related to the student y and z but not the student w. However when executing my queries it displays the teach...
asked by 22.11.2018 / 15:01
3
answers

How to select the last lines added in a mysql table

I have the following table sir_ter_conversa which is a history of conversations. id|idterreno|idincorporadora|idusuario|msg|data 1 | 1 | 771 | 771 | a |2018-05-27 10:20:00 2 | 1 | 771 | 773 | b |2...
asked by 24.05.2018 / 19:24