Questions tagged as 'sql'

2
answers

Create a custom order in SQL

I have a table ( groups ) in SQL with the following structure: id | name | description | display_order | ... The display_order field was set to UNIQUE and should be an integer. Its main function is to be used to create a...
asked by 19.05.2018 / 03:51
0
answers

How to query select with two different date formats in VB.NET?

Talk, guys! I have the dates with two different types of formats in the database, for example: MM / dd / yyyy dd / MM / yyyy HH: mm: ss But at the time of the VB.NET query, I did so and it does not work. Public Function teste (ByV...
asked by 24.04.2018 / 16:34
1
answer

Multiply two columns in a select

I have two columns ( valor_unitario and quantidade ) I wanted to make a select that multiplied all the columns of the valor_unitario * quantidade field. Example: Valor_Unit|Quantidade 15 * 2 + 10...
asked by 17.05.2018 / 15:35
1
answer

Error when adding FK

I found only this type of error in "Select", I followed all the restrictions but it did not work! Error from line: 86 in command - alter table tb_consulta add constraint fk_tb_consulta_tb_tratamento foreign key (idtrat) references tb_pacien...
asked by 28.04.2018 / 19:47
0
answers

Conversion failed when converting the varchar value '@userID' to data type int

The error is what is in the title, conversion char to int. "Conversion failed when converting the varchar value '@userID' to data type int." Thanks for any help and if you have any tips on good practice, it's even better, because I'm new to this...
asked by 10.04.2018 / 20:48
0
answers

Cast to decimal in LINQ?

Since there is no Convert.ToDecimal() in SQL language, how could I transcribe a as decimal(18,2) in LINQ ? I've tried through decimal.Round() but it's not working. I have the following query in SQL : SELECT [nu_a...
asked by 26.04.2018 / 21:04
2
answers

Help with handling employee schedules

I have a situation regarding the lunchtime of the employees of the company; I need to limit the number of employees who can have lunch at the same time, at least together within 15 minutes, so if I have 10 employees leaving for lunch at 12:00, t...
asked by 10.04.2018 / 18:29
1
answer

How to create this view in postgres?

CREATE VIEW grafico AS SELECT AVG(realizacao) , AVG(estima), AVG(fisiologica),AVG(seguranca),AVG(social) FROM necessidade; I'm trying to create a view that brings the average of five columns of the required table, but I can not create this vie...
asked by 26.03.2018 / 20:29
0
answers

Highlight day in "listMonth"

I put listMonth in my fullcalendar and would like it to highlight today's date in the list, same as the monthly view, does anyone know if possible?     
asked by 20.04.2018 / 17:27
0
answers

MYSQL - Detect break in sequence, with conditional

Hello, I need help to make a query or procedure to detect gaps in a numeric field, I have a fiscal invoice table, which has a num_nfe field, it must follow a sequence, there can not be gaps in the numbers and I must check in another field, the s...
asked by 20.04.2018 / 14:29