Questions tagged as 'sql'

2
answers

How to use a Case statement in Mysql?

I have two tables one is the detail of product and the other is the product, the problem lies in that I want to make a left join to bring me the data that are related in both tables, the attribute that must be related is the "Number of Pr...
asked by 19.10.2016 / 19:00
2
answers

Disadvantages with Store Procedure [closed]

I'm doing an SP to perform a specific search with parameters, but it brings me the following error. How to solve it?    Msg 137, Level 15, State 2, Procedure spPantallaTasa, Line 6   Must declare the scalar variable "@aseguradora".       M...
asked by 20.10.2016 / 17:08
1
answer

Insert records into a table based on the result of a query

I'm trying to insert a new row with some data for each value of a SELECT. I leave the last query that has occurred to me but that obviously does not work: SET @postid = (SELECT post_id FROM wp_postmeta WHERE meta_value LIKE '%barcelona%'...
asked by 14.09.2016 / 02:22
2
answers

Problem with UTF_8

Good morning, my problem is this, Php sends me the following Warning    Warning: utf8_decode () expects parameter 1 to be string, object given in. I have already reviewed my code and I have declared the characterSet in this mode "Chara...
asked by 25.08.2016 / 18:56
1
answer

Remove 0 from date result

I make this command to bring the date in a YYYY / MM / DD format: DECLARE @SomeExampleDate DATETIME; SELECT @SomeExampleDate = '2016/08/20'; SELECT STUFF(REPLACE('/'+CONVERT(CHAR(10),@SomeExampleDate,102), '.', '/'),1,1,'') But I want that...
asked by 20.08.2016 / 21:24
1
answer

How to Insert Date in SQLite

I have a query: I have a table in SQLite with this structure CREATE TABLE [Agenda] ( [Itinerario] VARCHAR(50) NULL, [Creado] TIMESTAMP NULL, [Fecha] TIMESTAMP NULL ) And I'm trying to enter rows with the following SQL statement:...
asked by 23.08.2016 / 19:01
3
answers

Clause Count (*) within a select

I have the following SQL query. What I do not know how to do is that the count (*), returns one more column, with the total number of records. The current query throws me errors, the count (*) is between
asked by 08.11.2016 / 00:04
2
answers

Distinct query with INNER JOIN in SQL SERVER?

Good morning: I have two tables in which the one by means of the reference, and it makes the query well, but I want to put the other fields of my table entsal and that are equal to the reference, for example add names , tea de la table entsal....
asked by 25.07.2016 / 15:43
1
answer

How to add different totals by columns in MySQL?

Good morning I have the following table in MySQL : id | pais | categoria 193 | BR | A 188 | BR | A 133 | BR | B 145 | BR | C 124 | CA | A 165 |...
asked by 21.02.2018 / 04:53
1
answer

How to put local -portable- database in c # (visual studio 2015, sql server compact)?

I was doing a system in c # , I had it connected to a database in access . But I realized that maybe I could not; Generate the installer of the program and pass it to another person. Someone told me to try to put a database of Sql Server Comp...
asked by 08.06.2016 / 03:49