Questions tagged as 'sql'

1
answer

Left Join does not return null values in PHPmyAdmin

Hi, I'm trying to make this query: SELECT consulta.id_consulta,actu_consulta.fecha_actu FROM consulta LEFT JOIN actu_consulta ON consulta.id_consulta=actu_consulta.id_consulta_actu And the funny thing is that this query i...
asked by 14.02.2017 / 12:42
1
answer

SQL statement to calculate fine value

I have a system to calculate a payment of fines to a user, this has the following two tables: FINES and FINES_USERS    NOTES: // In the table fines I have inserted the two types of fines, both normal and special, just change their typ...
asked by 09.02.2017 / 20:13
1
answer

Make column ItemID SQL Server 2008 R2

I have 2 Rows of name Type and TypeID I need to create a call ItemID that the itemID pick up the digits of the rows type and TypeID but that always the typeID is filled with zeros in case the numb...
asked by 20.01.2017 / 06:20
1
answer

Create a record for each field stored in a temporary table

I have the following query where in a temporary table I keep every Monday between a range of dates. DECLARE @TEMP TABLE(REGISTRO DATE) DECLARE @startdate datetime = '2017-01-19' DECLARE @enddate datetime = '2017-02-19' ;with cte(col) AS ( SELE...
asked by 19.01.2017 / 23:52
3
answers

Select a single record from those that have multiple duplicate fields

Good, I have the following structure in a database COD_ENTIDAD COD_IDCONTRA COD_CONCEGES COD_PRODGEST -------------------------------------------------------------- 1 0182 00000000000000000000000003 403Q 0012605...
asked by 19.01.2017 / 17:45
2
answers

Methods to call Store Procedure from C #

I have this method to execute stored procedures public void EjecutarSP(string sp) { try { SqlCommand cmd = new SqlCommand(sp, ConexionBD.con); cmd.CommandType = CommandType.StoredProcedure;...
asked by 03.02.2017 / 14:33
1
answer

Consultation sql java

I'm programming with Java. I am new in this language. What happens is that I insert a table in MySQL, but it appears:    SQLException: Unknown column 'jose' in 'field list' In fact, I printed the SQL and executed it in the PhpAdmin and it...
asked by 31.12.2016 / 04:28
1
answer

Java - SQL - Show data in a Java Swing form

I have a vehicle sales application. In the MySQL database I have purchased vehicles (for customers) and vehicles not yet purchased (available for purchase). In the database I distinguish the tables: vehicles and vehicles_buying. Organi...
asked by 11.01.2017 / 21:39
1
answer

Create trigger Sql server

I have this statement to import data to the test table, what I need is to create a trigger. BULK INSERT PRUEBA FROM 'C:\prueba.CSV' WITH ( -- seteamos el separador de campos FIELDTERMINATOR = ',', --seteamos el separador de registro ROWTERMINA...
asked by 27.12.2016 / 11:49
3
answers

Update only the field that has been sent using PHP and MySQL

I'm doing a blog, and when I edit that blog for example the title, the other variables are declared as undefinex , what can be done in this case? $body = $_POST['body-post']; $title = $_POST['title-post']; $img = $_POST['avatar...
asked by 16.12.2016 / 00:05