Skip to content
Advertisement

Tag: left-join

MySQL tree structure

Hello i am trying to prepare tree structure with MySql, tables look something like this. My Question is: Is it possible to do left join and sort columns by name, but if in lang is eq to “fra” return that row with that name, otherwise return “eng” name. Pseudo code So final result will be something like this, in total

Simple PostgreSQL Self Join

This is what my employee table looks like where manager_id is Foreign Key to the same table it references to employee_id and indicates which employee has manager and who is. I did self left join and the result was what was expected. But this query gives me So I don’t understand why it returns something instead of nothing.employee_id will never

Return in which or statement results are from SQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m having the following SQL statement, to return worksheets that teachers have liked, and worksheets that teachers made by themselves. It’s working fine, but now

select conditionally with conditional joins in mysql

I am trying to join two tables, people and sales, and displaying results based on a where condition which should be used to join the tables. My current attempt is showing only one result but I want all the rows in the people to be shown regardless of whether they have a record in the sales table, if they have

Advertisement