outer-join

LLBLGen - How to left join unrelated tables, and obtain records where there is no joined data

We are working with LLBLGen v2.6 and trying to pull back records which do not have a certain relation. This relation is a category with a one to many mapping, and one of our entities can have zero or many categories. We want the ones with zero. We have tried the following linq query, with little success. NoCategories is a boolean intend...

MySql Join with Sum

Hello, I have a table called RESULTS with this structure : resultid,winner,type And a table called TICKETS with this structure : resultid,ticketid,bet,sum_won,status And I want to show each row from table RESULTS and for each result I want to calculate the totalBet and Sum_won using the values from table TICKETS I tried to make some...

SQL Server 2008 Optimize FULL JOIN with ISNULL statements

HI All I was hoping someone could help me improve a query I have to run periodically. At the moment it takes more than 40 minutes to execute. It uses the full allocated memory during this time, but CPU usage mostly meanders at 2% - 5%, every now and then jumping to 40% for a few seconds. I have this table (simplified example): CRE...

ms access / sql server syntax (i guess)

this query: SELECT sentmails.[VersandDatum], sentmails.[DatumMailGeplant], mailintervals.[Interval], definitions.[Subject], users.[Name], sentmails.[MailArt], Objekte.[Name], sentmails.[Erledigt], sentmails.[ID] FROM Objekte RIGHT JOIN (users RIGHT JOIN (definitions RIGH...

mySQL outer join

I have 2 tables for which I need to run a query on Table1 has 2 fields: l_id, and name Table2 also has 2 fields: l_id, and b_id I need to run a query to get the "name" and "l_id" for all the entries in table1 that do not have an entry in table2 for a given b_id. Hope this makes some sense ...

Left outer join in linq

Hi all, I have the following query but i have no idea on how to do a left outer join on table 1. var query = (from r in table1 join f in table2 on r.ID equals f.ID select new { ...

Why does this left outer join query refuse to complete in phpMyAdmin?

EDITED: so the query does work, but on my localhost machine it took over a minute to run. Admittedly the tables are considerably larger on my localhost (about 8000 rows each), but in production the tables could have upwards of 25,000 rows each. Is there any way to optimize this so it doesn't take as long? As indicated in one of the comme...

How do I convert a "legacy" left outer join statement in Oracle?

I have two tables (A and G) in an Oracle database that can be joined together based off an account number. The one caveat to this is that one of the tables (G) has about 80 fewer records than the other. When I query the two tables together, I need to get all of the rows, so that we see NULL data in the columns for the missing 80 rows. I...

How to express outer joins with cross tables as a single Linq expression

Following situation: There exists an array acting as crosstable (mergeSet). Additionally there exists a set of target values and a set of source values. The source values can be joined with the target values via the crosstable. - But how is it possible to express an outer join of, e.g., the...

Oracle "(+)" Operator

I am checking some old SQL Statements for the purpose of documenting them and probably enhancing them. The DBMS is Oracle I did not understand a statement which read like this. select ... from a,b where a.id=b.id(+) I am confused about the (+) operator., and could not get it at any forums.. (searching for + within quotes didn't work...

SQL query LEFT JOIN issue (MySQL)

I have 2 tables SCHOOLS (ID, SCHOOL_NAME, CITY_ID) STUDENTS (ID, STUDENT_NAME, SCHOOL_ID). I want to list schools in a particular city along with the student count (School Name| Student Count) One way to do this is to have co-related subquery - select sh.school_name, (select count(*) from student where s...

Opposite Of An Inner Join Query

can someone help me write sql for a scernerio like this: Table 1 2 columns: ID, Name Table 2 2 columns: ID, Name I want a query to show names from Table 1 that are not in table 2. So filter out all the names in table 1 that are in table 2 is the result query. Use ID for the filtering not name. This will help me in what I am tryin...