Posts by Raquel Andrade • 85 points
9 posts
-
0
votes1
answer91
viewsA: Sqlserver: How to detect consecutive days in a table
I finally managed to solve it the following way: select * from (Select * from tabMemberships m ) a inner join (Select * from tabMembershipS m1) b on a.PersonID = b.PersonID and ((a.MembershipDate =…
-
0
votes1
answer91
viewsQ: Sqlserver: How to detect consecutive days in a table
I need to insert into a time table only the rows of another table in which the Membershipdate column has 1 day difference dates. For example, in the table image below, only lines 1, 2 and 3 would go…
-
0
votes3
answers212
viewsA: Relational Algebra - Query in 3 tables
Taking into consideration the comment: I would like to return the nomep when the name is "Round Top 1m" and "Screw 3cm", I believe you can try something like: Select * from material_peca AS MP inner…
-
4
votes2
answers1851
viewsQ: What is the problem of using [n]varchar(max)?
Why the practice of using [n]varchar(max) can cause problems? In my scripts whenever I don’t really know what the length of a string and to prevent problems, I have used nvarchar(max). A few days…
-
0
votes2
answers75
viewsA: List only if the other table does not have a dismissal
I believe you have to also put conditions related to the type or nature of examination. Just looking at the samples of the tables you passed, I get a little bit in doubt of what it would be:…
-
1
votes3
answers2475
viewsA: Return 0 if the value does not exist in the table
I believe it would be something like this, but I have no way to test it at the moment. SELECT COALESCE( (SELECT SEQ_RESUMO FROM INICIO_FIM_COLETA WHERE seq_picking = '244582'), 0) as sequence from…
-
0
votes1
answer60
viewsA: I NEED HELP ORDERING A QUERY
I believe you can do something like: GROUP BY CONVERT(date, CreatedOn) , rl.WipOrderNo, rl.RegularHours ORDER BY CONVERT(date, CreatedOn) desc…
-
0
votes0
answers23
viewsQ: SQL - Difference between Mandatorykey and Mandatoryfkey
I’m in my first internship since I started IT and the area I’m interning in is Databases. I have studied some old scripts and saw that some variables were declared, for example: @country AS…
-
0
votes1
answer265
viewsQ: How to check if an XML type field is null or empty in SQL SERVER
I need to check the amount of 0, NULL or empty in fields of different types, My difficulty is when it comes to fields of type XML. I tried to include in my logic the function exist(), but I do not…