cross-apply Questions
15
Solved
What is the main purpose of using CROSS APPLY?
I have read (vaguely, through posts on the Internet) that cross apply can be more efficient when selecting over large data sets if you are partitioni...
Bridging asked 16/7, 2009 at 17:42
3
Solved
I need to use CROSS APPLY in MySQL (EC2 RDS MySQL instance).
Looks like MySQL doesn't recognise the CROSS APPLY Syntax. Can someone help me please?
Here's the query.
SELECT ORD.ID
,ORD.NAME
,OR...
Disabled asked 26/4, 2016 at 15:22
1
Solved
I am writing some code to query some DMVs. Some of the columns may or may not exist in the DMV depending on SQL version. I found an interesting suggestion online how to skip specific checking using...
Suellen asked 20/11, 2019 at 23:26
2
Solved
On a separate thread I got a working example on how to translate my stored proc to a view, that will hold customer names to orders mapping, where orders are comma-separated lists of orders, includi...
Astonishing asked 3/11, 2010 at 17:4
4
In the below example, I'm trying to count the number of drinks I can make based on the availability of ingredients per bar location that I have.
To further clarify, as seen in the below example: b...
Brenneman asked 28/6, 2018 at 13:0
2
Solved
I read, CROSS APPLY is just like JOIN.. and I think JOIN can be accomplished with EXISTS also (correlated sub query)
I am confused, what is the difference in using CROSS APPLY and EXISTS?
when sh...
Benghazi asked 12/3, 2012 at 11:10
1
Solved
I want to use CROSS APPLY to UNPIVOT multiple columns.
The columns CGL, CPL, EO should become Coverage Type, the values for CGL, CPL, EO should go in column Premium, and values for CGLTria,CPLTri...
Counterattraction asked 7/2, 2018 at 0:52
2
Solved
When creating a cartesian product between two tables, is there any difference between CROSS APPLY and OUTER APPLY?
This may seem like a silly question given that without a relationship expressed b...
Primine asked 26/1, 2018 at 11:5
1
Solved
I have a series of OPENJSON statements and on the final step of my stored procedure, I parse some JSON from the final column in the second-to-last table. The last column is almost always empty, but...
Hensley asked 24/2, 2017 at 1:4
3
I have problem with CROSS APPLY with parametrised table valued function.
Here is simplified pseudo code example:
SELECT *
FROM (
SELECT lor.*
FROM LOT_OF_ROWS_TABLE lor
WHERE ...
) AS lor
CROS...
Hornwort asked 26/4, 2013 at 11:51
1
Solved
I know there are several unpivot / cross apply discussions here but I was not able to find any discussion that covers my problem. What I've got so far is the following:
SELECT Perc, Salary
FROM (
...
Maudemaudie asked 22/3, 2016 at 9:16
4
Solved
I need to migrate SQL queries written for MS SQL Server 2005 to Postgres 9.1.
What is the best way to substitute for CROSS APPLY in this query?
SELECT *
FROM V_CitizenVersions
CROSS APPLY
dbo....
Meryl asked 13/7, 2012 at 14:44
2
Solved
I have a table which store 1 row per 1 survey.
Each survey got about 70 questions, each column present 1 question
SurveyID Q1, Q2 Q3 .....
1 Yes Good Bad ......
I want to pivot this so it reads
...
Campion asked 17/9, 2015 at 20:57
2
Solved
There is a simple code. I always thought that both outside ROW_NUMBER and the one in CROSS APPLY clause are supposed to generate the same output (in my example I excepct rn = crn). Could you please...
Lenalenard asked 9/7, 2015 at 11:24
2
Solved
What I Have
I have a variable size XML document that needs to be parsed on MSSQL 2008 R2 that looks like this:
<data item_id_type="1" cfgid="{4F5BBD5E-72ED-4201-B741-F6C8CC89D8EB}" has_data_ev...
Intellectualism asked 13/6, 2014 at 1:44
2
Solved
I have a query like the following:
SELECT A.a, A.b, B.c,
(CASE WHEN ... THEN ... ELSE ... END) AS CalculatedValue,
B.d
FROM dbo.TableA A INNER JOIN
dbo.TableB B ON (...)
WHERE (CASE WHEN ... THEN...
Flammable asked 8/2, 2012 at 17:6
2
Solved
I have the following functions:
FunctionA - returns Object ID and Detail ID
FunctionB - returns Detail ID and Detail Name
The following query is used to extract Object ID, Detail ID and Detail N...
Noelyn asked 24/2, 2014 at 11:39
6
Solved
This process has several steps which are reflected in various tables of a database:
Production --> UPDATE to the inventory table using something like
UPDATE STOR SET
STOR.BLOC1 = T.BLOC1,
STOR....
Rosario asked 19/2, 2014 at 22:1
2
Solved
I would like to create a query with a cross apply into a user defined table value function in LINQ. The SQL would be really rather simple as below:
SELECT *
FROM MyTable mt
CROSS APPLY MyTVF(mt.id...
Gerstein asked 22/6, 2010 at 8:39
3
Solved
http://sqlfiddle.com/#!3/78273/1
create table emptb1
(
id int,
name varchar(20),
dept int
)
insert into emptb1 values (1,'vish',10);
insert into emptb1 values (2,'vish',10);
insert into emptb1 va...
Nova asked 16/12, 2013 at 14:12
2
Solved
I want to create some test cases for Entity Framework queries that surely generate SQL commands that contain CROSS APPLY or OUTER APPLY operators.
Could someone show typical scenarios where these ...
Suzettesuzi asked 11/5, 2013 at 19:35
1
Solved
Is it possible to use the cross apply clause in the from part of an update statement, in SQL Server 2005?
Scorpius asked 20/9, 2011 at 22:59
2
Solved
I am trying to get the count of nodes in an XML field. but I always see 0 as the result. Here is how my query looks like.
DECLARE @XmlTable TABLE (XmlResult XML)
INSERT INTO @XmlTable EXECUTE [...
Douro asked 25/3, 2011 at 21:38
2
Solved
Customer has shortcuts in their data where they have a quantity of records in a field. When I parse them, I need to manufacture records, one for each quantity, incrementing the "identifier" by 7 da...
Isolation asked 6/11, 2009 at 23:57
1
© 2022 - 2024 — McMap. All rights reserved.