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
93 Views Asked by simran kukreja At
1
There are 1 best solutions below
Related Questions in SQL-SERVER
- Dynamic query creation with Array like implementation
- 'pyodbc.Cursor' object has no attribute 'callproc', mssql with django
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- PHP Laravel SQLServer could not find driver
- Upsert huge amount of data by EFCore.BulkExtensions
- How to locate relevant tables or columns in a SQL Server database
- Cannot delete SQL datafile (.mdf) as its currently in use
- Writing query in CTE returning the wrong output
- Group By Sum and without Group by sum Amount is different
- plan_handle is always different for each query in SQL Server Cache
- Adding a different string to a table fails
- The specified data type in the EF modelBuilder doesn't correspond to the one that is created
- SQL71561: SqlComputedColumn: When column selected
- How to Solve Error Associated with Trusted Authority
- SQL Server Data Model and Insert Performance
Related Questions in ORACLE
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Oracle setting up on k8s cluster using helm charts enterprise edition
- Oracle Managed Data Access Client can't work from IIS but work for local debug environment
- If composite indexing created - indexing is called?
- Oracle Http server ISNT-07551
- why here not creating table?
- Data migration from Oracle Database Clob to GCP Bucket
- SQL Alchemy custom type, forcing blob bind parameter
- How to send message to syslog agent in plsql
- Whatever the data available in previous record it should add to the new record
- I have an Oracle SQL query that is giving me a "ORA-00918: column ambiguously defined" error on a line that is a comment line
- 'ORA-12170: TNS:Connect timeout occurredORA-12170: TNS:Connect timeout occurred' ERROR while working on oracle with laravel
- Is their any way i can open parallel query tabs
- VSCode Libraries not showing for New Java Project
- I can't ssh to my instance, Connection refused
Related Questions in CONNECT-BY
- Oracle CONNECT BY when one of multiple columns can be parent id
- Connect by prior - is this an Oracle bug?
- Why oracle constructs cartesian join with 'start with' statement
- Using an oracle sequence directly in the CONNECT BY clause
- Using columns from two different tables in connect by prior clause in SQL
- How to improve processing time for queries that use CONNECT BY and LEVEL clause
- Snowflake: PRIOR keyword is missing in Connect By statement
- Oracle Hierarchical queries: Translate START WITH ... CONNECT BY PRIOR into 'Recursive Subquery Factoring'
- Oracle SQL Connect By Level - literal does not match format string
- Get Ultimate manager oracle
- Formatting a hierarchical query in a nested tree syntax (Oracle)
- Oracle: Trying to split a string using REGEXP_SUBSTR, CONNECT BY LEVEL functions and getting duplicates
- Why does deterministic function return unexpected numbers in CONNECT BY LEVEL query?
- Multi column hierarchical query in Oracle SQL
- I need to convert this query from Oracle to SQL Server
Related Questions in RECURSIVE-CTE
- clean ways to perform calculations with values sourced from nested groups of varying depths?
- finding connected components using BigQuery SQL
- recursive CTE with two child column
- SQL, Recursive query to get ancestors with some rules of all parents
- Optimise recursive CTE or rewrite to PL/pgSQL LOOP
- Issues implementing a recursive CTE that updates a column(postgres)
- With recursive cte query in MySQL
- Parent Child table with "N" number of levels
- SQL recursive cte - sort overlapping range
- Delete rows based on age, status and existence of related rows with recursion in PostgreSQL
- Find nth parent that matches some condition
- Postgres: query average landed cost from prior records
- Calculate cumulative sum over partitions with gaps in SQL
- Multiple column Tree Hierarchy (Manager, Employee) in Oracle Sql
- need to know about the recursive view in snowflake
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 # Hahtags
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