Skip to content
Advertisement

Left Outer join and an additional where clause

I have a join on two tables defined as a left outer join so that all records are returned from the left hand table even if they don’t have a record in the right hand table. However I also need to include a where clause on a field from the right-hand table, but…. I still want a row from the

Should every SQL Server foreign key have a matching index? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 months ago. The community reviewed whether to reopen this question 7 months ago and left it closed: Original close reason(s) were not resolved Improve this question

SQL vs noSQL build examples

Could I have a list of type of applications I should build on a sql database and a list of applications i should build on a nosql database?

How to get the difference between two dates rounded to hours

I’ll illustrate what I would like to get in the following example: Using TIMEDIFF(), we get 2 as a result. This means, it’s not considering the 50 minutes left. In this case, what I’d like to get is: 50 (minutes) / 60 = 0.83 period. Therefore, the result should be 2.83 and not 2. Answer

Query to group by maximum depth of PostgreSQL Ltree?

I want to query for all products with the name “Shania Twain”, but I want group them only by the tree with the deepest nlevel. Assuming I have a table like the following with the name categories So, for example, The problem lies with the HAVING clause requiring a boolean expression. The clause MAX(nlevel(cat.tree)) will return an integer. How do

Advertisement