Questions tagged as 'sql'

0
answers

Hibernate should mount query only with the required joins

I have list with createCriteria on it I have several ifs to query only the parameters queried on the form, however, the hibernete by default at the time of the query assembly joins all tables that have constraints: select *from volume this_...
asked by 07.03.2018 / 21:13
2
answers

SQL query that compares two tables and returns values

Working with a database using PostgreSQL DBMS, where I need to compare tables, eg: table_janeiro and table_February. I need to perform two queries ... 1st Should return the values contained in the table_janeiro and do not contain in th...
asked by 07.03.2018 / 20:08
0
answers

Sql does not recognize the movie

I'm having a problem where sql does not recognize the pussy <div class="col-md-6 form-left"> <select name="utilizadores" > <option value="0">Utilziadores ativados</option>...
asked by 05.03.2018 / 13:28
0
answers

Call one procedure inside another - MySql

I have to retrieve some values before running my cursor, as the MySql syntax does not allow to make select before the cursor declaration, I thought of dribbling, doing the select in a first procedure and then calling the second that will iterate...
asked by 05.03.2018 / 14:50
1
answer

Result SQL statement

Hello! I have a table of a questionnaire, I would like to have a result grouped by "property", doing a GROUP_CONCAT in the "answers", according to the model below: property | question | answers     10 | 1 | rice, beans     10 | 2 | rice, be...
asked by 02.03.2018 / 21:22
0
answers

Select location from the status

I have the following (fictitious) structure Status table: id | name | status Location table: id | title | estado_id On my front end I have a navbar that will list the states and in each state the locations. I'm using...
asked by 10.03.2018 / 02:07
0
answers

SQL query with start date and end date

I need to read some values in a table, I have to bring the values from 02/23/2016 until 02/23/2018, I tried to do it in SQL but it did not work so well, code below: SELECT u.nome, un.descricao, (SELECT COALESCE(COUNT(DISTINCT(mc.id_marcacao_co...
asked by 09.03.2018 / 23:59
0
answers

SQLSTATE [HY000] General SQL Server error: Check messages from the SQL Server (severity 14) (SQL: select * from [product])

I have an application in laravel connecting in the database on a SQL Server when I will make a query of all the products I am getting the error SQLSTATE[HY000] General SQL Server error: Check messages from the SQL Server (severity 14) (SQL: se...
asked by 01.03.2018 / 20:55
1
answer

How to generate a counter within a select (SQL server)

I need to make a select with a case, if the condition is true I need to use a counter that will be a new column, otherwise the counter will be displayed without any changes, but I'm not able to do it, I tried the ROW_NUMBER function but it did n...
asked by 01.03.2018 / 17:51
0
answers

Error running BCP on Azure VM

In a .bat file I have the command BCP inserting records from a CSV file into the SQL database in Azure, and this works perfectly. But when I run this same .bat (with directory settings) file in the Azure VM the...
asked by 27.02.2018 / 14:08