left

Linq to Entity with multiple left outer joins

Hi, I am trying to understand left outer joins in LINQ to Entity. For example I have the following 3 tables: Company, CompanyProduct, Product The CompanyProduct is linked to its two parent tables, Company and Product. I want to return all of the Company records and the associated CompanyProduct whether the CompanyProduct exists or no...

How do you use LEFT on a NTEXT SQL Server Column?

How do you use the LEFT function (or an equivalent) on a SQL Server NTEXT column? Basically I'm building a GridView and I just want to return the first 100 or so characters from the Description column which is NTEXT. ...

WPF: HorizontalAlignment=Stretch, MaxWidth, and Left aligned at the same time?

This seems like it should be easy but I'm stumped. In WPF, I'd like a TextBox that stretches to the width of it's parent, but only to a maximum width. The problem is that I want it to be left justified within its parent. To get it to stretch you have to use HorizontalAlignment="Stretch", but then the result is centered. I've experimented...

Left() function in Javascript or jQuery

Hi, I just want a very handy way to extract the numbers out of a string in Javascript and I am thinking about using jQuery, but I prefer the method that proves to be the simplest. I have requested the "left" attribute of a css block using jQuery like this: var stuff = $('#block').css("left") The result of "stuff" is 1008px I just w...

sql left join and duplicates in result

Say I have 2 tables, A and B, each A entity can possibly have multiple B entities, in one case if I want to get all B's of some certain A's, I might do it with a simple left join select A.id aid,B.id bid from A left join B on B.aid = A.id where A.id = 1 and it will return a result set like aid bid 1 1 1 2 1 3 As you...

MySQL LEFT JOIN after 5.0.12 changes - How to rewrite query

After 5.0.12 MySQL changed the syntax for left joins to match SQL2003 standard. So ... FROM t1 , t2 LEFT JOIN t3 ON (expr) needs to be rewritten as ... FROM (t1 , t2) LEFT JOIN t3 ON (expr or else it will be parsed as ... FROM t1 , (t2 LEFT JOIN t3 ON (expr)) Now, I have an ancient app I'm porting from MySQL 3.23 (eek!) to 5.1, a...

Advanced multiple join in subquery using LINQ

I have spent the afternoon trying to wrap my mind around how to translate the following query into LINQ, but I can't quite get there. declare @productId int; set @productId = 3212; select * from InformationData data where productId = @productId and orgId = 1 and exists( select id from ( select coalesce(id1.id, id2.id, id3.id)...

How would one make it so that divs do not stack upon one another based on browser window size or screen resolution when divs are floated to the left?

Sorry if my wording is... unclear. I really had no idea how to properly explain my dilemma. But lets seen if I can do it better here... I am making a blog in which posts will be displayed and scrolled through horizontally, rather than vertically. Each blog post is displayed in a separate div, and the divs are displayed side by side by f...

LEFT JOIN using OR

I was wondering how I would return the result of the left most condition in a OR clause used in a LEFT JOIN if both evaluate to be true. The solutions I've come upon thus far both involve using CASE statement in the SELECT, this does mean I'd abandon the OR clause. The other solution involved using a CASE statement in an ORDER BY. Is ...

Bind Results from a Left Join using mysqli

Hi, I'm recently changing to mysqli and while performing an update on a script, i couldn't manage to use the same SELECT information as i did before. How can I bind_results from a Left Join between 3 tables? This is the script: "SELECT actor.id, actor.name, actor.gender, thumbs.id, thumbs.filename, thumbs.actorid FROM actors, thum...

How to pack a tkinter widget underneath an existing widget that has been packed to the left side?

Hi all, I'm attempting to write a basic Tkinter GUI that has a Text widget at the top, then a Button widget left aligned under it, then another Text widget underneath the button. The problem I'm having is, after packing the Button widget to the left, when I then go to pack the second Text widget, it puts it next to the button on the ri...

Linq to entities Left Join

Hi all, I want to achieve the following in Linq to Entities: Get all Enquires that have no Application or the Application has a status != 4 (Completed) select e.* from Enquiry enq left outer join Application app on enq.enquiryid = app.enquiryid where app.Status <> 4 or app.enquiryid is null Has anyone done this before without using...

Left join in SubSonic Problem

I'd like to perform an left join in this query.The query like: select ... from tableA left join tableB on tableA.Cola=tableB.Colb and tableB.Colc='some value' I want to know how to perform the "and" condition,i try to coding like: new SubSonic.Select().From("tableA").LeftOuterJoin ("tableB","Colb","tableA","Cola").AndExpression("Colc...

Where is the "LEFT" operator in LINQ?

Using SQL Server 2005 I've run a query like this SELECT * FROM mytable WHERE (LEFT (title, 1) BETWEEN @PREFIXFROM AND @PREFIXTO) I use this to do alphabet filtering, so for example PREFIXFROM = a PREFIXTO = c and I get all the items in mytable between a and c (inclusive) How do I do this in linq? Selecting all the records fine.. bu...

Can't use "Skip" in LINQ query

I have a linq query in which I need to specifically do a left join. However when I attempt to commit a lambda Skip function on the query it errors and says that the skip cannot be performed on a linq query with a join. Here's the query (the skip variable is a parameter into the function and clientDB is the datacontext): Dim...

Linq with array

Dim Cozinhas as string = "1, 2, 3" Dim FiltroCozinha() As String = Cozinhas.Split(",") Dim Empresas = (From E In lstEmpresas _ Group Join CE In lstCozinhasEmpresas On CE.EmpresaID Equals E.EmpresaID Into CEJ = Group From CE In CEJ.DefaultIfEmpty() _ Group Join FC In lstFiltroCozinha On FC Equals CE.Cozinh...

MySQL: get records from database and add a COUNT() column to the rows

I'm trying to retrieve books from one table and left join the chapters table. What I need from the second table is just the COUNT() of chapters available for those books and add that value as an extra column called chapters (or something else). My current try looks like this: SELECT b.*, count(c.chapter_nr) as chapters FROM books as b l...

how to disallow a div's 'left' property from exceeding a specified number

I'm using this tiny drag plugin to drag div.slider horizontally across it's div.container. I do not want div.slider to be able to go past the bounds(don't want it to exit) div.container. so when div.slider reaches the very right side of it's container div.container, i want it to not allow the user to drag it any further right, so that it...

MySQL Multiple Left Joins

I am trying to create a news page for a website I am working on. I decided that I want to use correct MySQL queries (meaning COUNT(id) and joins instead of more than one query or num_rows.) I'm using a PDO wrapper, that should function fine, and this still fails when run directly through the MySQL CLI application. Basically, I have 3 ta...

Left inverse in numpy or scipy?

I am trying to obtain the left inverse of a non-square matrix in python using either numpy or scipy. How can I translate the following Matlab code to Python? >> A = [0,1; 0,1; 1,0] A = 0 1 0 1 1 0 >> y = [2;2;1] y = 2 2 1 >> A\y ans = 1.0000 2.0000 Is there a numpy or scipy eq...