Questions tagged as 'sql'

2
answers

How to sort by the largest number of groupings, excluding who has no more than one grouping?

I need to sort my records by the largest number of GROUPS , that is, I have the SQL below and I need the TYPE column to be grouped >, be sorted from the largest grouping to the smallest, excluding display of TYPE that does not have GRO...
asked by 17.03.2016 / 12:58
2
answers

Oracle Insert multi-line

I need to insert multiple records into a table where only one of them will change, the others are constant. For example: Insert into processo (ID, status, descricao) values (1, 'X01', 'lorem ipsum dolor') I have to make hundreds of inser...
asked by 17.03.2016 / 17:54
1
answer

C # - Display search results in DataGridView (SELECT SQL)

Hello! I'm starting effectively in C # and I already have small projects. I can already connect to the remote database, I can already execute queries, I just can not get the result of a Select and show in a DataGridView. Honestly, if there is a...
asked by 15.03.2016 / 22:33
1
answer

How to set the initialization value of a PRIMARY KEY field defined as IDENTITY in SQL Server?

In MySQL when creating a table with an AUTO_INCREMENT field being PRIMARY KEY it is possible to define what will be the initialization value of the first record of it, as follows the script below: CREATE TABLE IF NOT EXISTS 'tb_exemplo' ( 'i...
asked by 12.02.2016 / 02:25
1
answer

Select min () returning value other than 0

I need to make a select where you get the lowest value found, other than 0 (zero), SELECT MIN(VALORTARIFA) MENORTARIFA FROM TABELA In the above command, if there is any 0.00 value, it returns me 0.00 and I only want the highest value...
asked by 12.02.2016 / 13:51
1
answer

SQL - Update without losing values

Well my personal question is the following I would like to update a value in the "Database" without losing the value there already allocated, Good for better understanding of my doubt Irie cite an example: I have a CALLED TABLE: Clients; With co...
asked by 06.01.2016 / 03:47
3
answers

Select Oracle returning many times the same result

My select works and returns the data I need, but it is returning more than 6000 times the same result. How do I return the result in only 01 line. NOTE: There is only one result for this code sq_transação , there is no possibility of...
asked by 05.01.2016 / 22:38
1
answer

Query in 3 tables and comparisons with sql

Good evening! I'm stuck here. I'm thinking of the best way to solve a solution. The problem is as follows: I have 3 tables with the names of monsters, items and inventory. The Monster has an inventory, this inventory has 48 spaces. Each space ma...
asked by 14.12.2015 / 23:19
1
answer

Parameter-based query in SQL Server

I have a situation where I need to bring results depending on the parameter reported. If I enter some number, that would be the code, it would only bring the result that has the code. If I did not report anything, it would fetch all the results...
asked by 17.12.2015 / 14:50
2
answers

How to perform a SUM in Hibernate

I'm trying to do a select via HQL but Java can not identify SUM by generating the following error: java.lang.NullPointerException at org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions$SumFunction.determineJdbcTypeCode(StandardA...
asked by 19.02.2016 / 23:02