?
Solved

Convert this query int LINQ..possible??

Posted on 2013-11-20
1
Medium Priority
?
268 Views
Last Modified: 2016-02-10
Hello, I would like, if possible, to convert this SQL query into LINQ. Basically is a group query that joins to itself.

select t1.invoiceno  from testdups as t1
left join testdups as t2 on t1.InvoiceNo = t2.invoiceno
where t1.IsInvoice <> t2.IsInvoice
group by t1.invoiceno
having count(t1.invoiceno)> 1

thanks!
0
Comment
Question by:arcross
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 39662714
Hi arcross;

Give this a try to see if it comes out with what you are looking for.

Dim result = From t1 in DataContextInstance.testdups _
             Join t2 in DataContextInstance.testdups On t1.InvoiceNo = t2.InvoiceNo _
             Where t1.IsInvoice <> t2.IsInvoice _
             Group t1 By Key = t1.InvoiceNo Into Group _
             Where Group.Count > 1 _
             Select Group.Key

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question