SELECT
ffl2.fee_record_code,
(SELECT max(fee_record_code)
FROM fees_list ffl3
START WITH ffl3.fee_record_code = Nvl(ffl2.fes_associated_record, ffl2.fee_record_code)
CONNECT BY PRIOR ffl3.fee_record_code = ffl3.fes_associated_record) final_record_code
FROM
fees_list ffl2
I need to convert this query from Oracle to SQL Server
90 Views Asked by simran kukreja At
1
There are 1 best solutions below
Related Questions in SQL-SERVER
- SQL server not returning all rows
- Big data with spatial queries/indexing
- Conditional null constraint on Null
- SQL Query - Order by String (which contains number and chars)
- Optimising a slow running SQL Server Stored procedure ordered by calculated fields to return a closest match
- Dynamics CRM Publishing Customizations - Multi Developers
- Is there anyway to set the relationship of many tables from Model?
- Implementation of Rank and Dense Rank in MySQL
- ORM Code First versa Database First in Production
- MVC : Insert data to two tables
- Data streams in case of Merge
- table with multiple IDs but seperate notes need sorting (Tried SQL code to make a union query)
- SQL table Partitioning by Year with ColumnStore index implemented on the table
- Defining which network to use for SQL Server 2012 Management Studio
- Fill a week days in a table with preceding Sundays value
Related Questions in ORACLE
- Column displays each count
- MAX and GROUP BY - SQL
- Best Practice for adding columns to a Table in Oracle database
- Updating an Oracle row with value from same row
- Retrieving data from Oracle database
- Ibatis execute update sql on oracle, it is not working and no exceptions
- Building an sql execution plan history
- Implementation of Rank and Dense Rank in MySQL
- how to update the date field for this specific condition using oracle query?
- Oracle stored procedure wrapping compile error with inline comments
- Android: How to connect oracle database using Android Java code?
- SQL Conditional Join on Columns
- Multi value wildcard search in ibatis
- Get count of consecutive days meeting a given criteria
- How to update the metadata of a layer in Oracle imported through FME Workbench?
Related Questions in CONNECT-BY
- Not sure how to write connect by clause
- CONNECT BY NOCYCLE PRIOR 10G Optimiser Mode
- Summarize in ORACLE hierarchical query
- Can't use CONNECT BY and GROUP BY together
- Access path between parent and child tables in oracle
- Oracle 10g PL/SQL Connect By Prior returning Child and Parent on same row
- A connect by query on all children
- Connect By query with recurring hierarchical checks
- ORA-01436 when trying to export CONNECT BY PRIOR result
- Why oracle constructs cartesian join with 'start with' statement
- CONNECT BY and START WITH clauses in oracle sql
- SQL Optimization: CONNECT BY ... START WITH
- Oracle 12c Recursive query for Product , Category relationship
- Oracle INSERT and CONNECT by
- I need to convert this query from Oracle to SQL Server
Related Questions in RECURSIVE-CTE
- SQL OpenQuery with Recursive CTE
- How to sum a column in SQL Server recursive cte for optimization?
- Postgres: query average landed cost from prior records
- Find nth parent that matches some condition
- Delete rows based on age, status and existence of related rows with recursion in PostgreSQL
- SQL recursive cte - sort overlapping range
- Is it possible to utilize Recursive CTE in this example?
- Fill missing rows using RECURSIVE CTE in SQL SERVER
- CTE performance issue when add one more field on selection list
- traversing recursive CTE to the root in SQL Server reaches maximum recursion
- I need to convert this query from Oracle to SQL Server
- Recursive CTE in EF Core + Automapper ProjectTo
- MySQL recursive cte base case
- Recursive CTE to find Total for all children parent and depth
- get last node given the full path of all ancestor's node attributes using cte
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
SQL Server does not have
CONNECT BY. You need to use a recursive CTE.Unfortunately, you cannot put a recursive CTE into a subquery or derived table. So the easiest way to solve your particular problem is to use an inline Table Valued Function