Linq to SQL Nested IN FROM query
Can anyone tell me how to write a nested SQL query like SELECT * FROM X WHERE X.ID IN (SELECT Y.XID FROM Y WHERE .....) in LINQ? ...
Can anyone tell me how to write a nested SQL query like SELECT * FROM X WHERE X.ID IN (SELECT Y.XID FROM Y WHERE .....) in LINQ? ...
Hi, Considering the following table I have a large table from which I can query to get the following table type no of times type occurs 101 450 102 562 103 245 111 25 112 28 113 21 Now suppose I wanted to get a table which shows me the sum of no of times type oc...
I'm looking to build a query that will use the non-clustered indexing plan on a street address field that is built with a non-clustered index. The problem I'm having is that if I'm searching for a street address I will most likely be using the 'like' eval function. I'm thinking that using this function will cause a table scan instead o...
My team is developing a large java application which extensively queries a MySQL database (in different classes and modules). I'd like to known if there is a pattern that allows me to be notified at compile time if there are queries that refer to a wrong table structure (for instance if I remove or add a field on a table and the query s...
As the topic suggests I wish to be able to pass Table Names as Parameters using .Net (doesn't matter which language really) and SQL. I Know how to do this for values, i.e command.Parameters.AddWithValue("whatever",whatever). Using @whatever in the query to denote the Parameter. The thing is I am in a situation where I wish to be able to...
We are building a query to count the number of events per hour, per day. Most days there are hours that do not have any activity and therefore where the query is run the count of activities per hour show up but there are gaps and the query excludes these. We still want to show the hours that do not have activity and display a zero so tha...
When I use (in MS Access 2003 SP3): SELECT * INTO NewTable FROM SomeQuery; MEMO fields are converted to TEXT fields (which are limited to 255 characters), so longer texts are cut. The output of the query itself is fine and not truncated; the text is cut only in the new table that is created. An update: I managed to focus the proble...
I am looking to export a few files into Excel from MS Access based on querying a table. It's like this the query will be select * from table where field = 0 I would like to loop the query till field is 9 and I want to save each result in a different name like field1, field2 How will this have to be modified? strqry = "select ...
I have a 3 table SQLServer Database. Project ProjectID ProjectName Thing ThingID ThingName ProjectThingLink ProjectID ThingID CreatedDate When a Thing is ascribed to a Project an entry is put in the ProjectThingLink table. Things can move between Projects. The CreatedDate is used to know which Project a Thing was last moved too. I ...
I am getting comfortable writing regular queries in SPARQL, but I'm still having trouble with fancier stuff. My latest problem is trying to select everything except stuff that matches the where clause. For instance, say I want to find all the husbands who like a car color that their wife doesn't like (I'm working on a proprietary model...
Is is possible to query the current browser from within an applet? I would like to know if the current browser is IE6 or IE7. ...
I'm trying to select more than 80,000 record in SQL Server in a table that has millions of records. The issue is that I've the correct Index, but it takes more than 15 minutes to return the recordset. I'm using MS SQL Server 2000, I found a pagination method using stored procedures but it uses a temporal table that I have to insert the ...
Here is my SQLCommand object: oCommand.CommandText = "INSERT INTO hits (id,client_id,client_ip,page,vars) VALUES _ (@@IDENTITY,@client_id,@ip,@page,@vars)" oCommand.Parameters.Count = 4 >> oCommand.Parameters.Item(0).ParameterName = "@client_id" >> oCommand.Parameters.Item(0).Value = "123456" >> oCommand.P...
Well I run a small video website and on the actual video page there is a strip of "related videos" similar to most video sides (e.g. YouTube) and currently all I'm doing is taking one of its tags randomly and finding other videos with the same tag. Not surprisingly this isn't a great method as some tags are very vague and some videos ar...
Hey, I stumbled upon this site looking for solutions for event overlaps in mySQL tables. I was SO impressed with the solution (which is helping already) I thought I'd see if I could get some more help... Okay, so Joe want's to swap shifts with someone at work. He has a court date. He goes to the shift swap form and it pull up this week'...
I seem to have a problem with this SQL query: SELECT * FROM appts WHERE timeStart >='$timeStart' AND timeEnd <='$timeEnd' AND dayappt='$boatdate' The time is formatted as military time. The logistics is that a boat rental can be reserved at 7am til 1pm or 9am til 1pm or 9am til 5pm. If there is an appt within that range, it should ...
I'm trying to write a circuit schematic drawing tool in Python. I'm creating a simple database based on dictionaries which holds all the components and their properties. I'm also trying to create a simple query language where you can select, for example, all resistors with value>100ohms or footprint='0402' So far, I can select thing...
Is there any way to get around the Oracle 10g limitation of 1000 items in a static IN clause? I have a comma delimited list of many of IDs that I want to use in an IN clause, Sometimes this list can exceed 1000 items, at which point Oracle throws an error. The query is similar to this... select * from table1 where ID in (1,2,3,4,...,...
I have a table, with 2 important columns DocEntry, WebId Sample data is like DocEntry WebId 1 S001 2 S002 3 S003 4 S005 Now as we can notice here, in column WebId, S004 is missing. How can we locate such missing numbers, with a query. Further explanation: The web id should be in increasing order lik...
hi, sorry for my previous question which was very ambiguous, but i think if i get the answer to this question I can work it out. In the program below i have selected the barcodes of products where the amount is less than the quantity. I want to say, that if the barcodes(in the fridge table) match barcodes in another table(products), set ...