Suljettu

DB2 on Cloud: Recursive SQL statement to select all children (even grand and great grand children) ids.

I am using Db2 on Cloud database. the scenario is users can create posts, and other users can create comments. Each post/comment has corresponding data in another database that requires being deleted too once any post/comment is deleted. So I need to fetch every comment id on a post being deleted and all of the comments of the comments, and all the comments of those comments, and comments on those comments (could go on forever). I am having difficulty writing this what seems to be recursive SQL statement to select all of the id's for all these elements.

What I've been trying: SELECT CONNECT_BY_ROOT id AS id, parentId AS parentId, threadId AS threadId, LEVEL AS level FROM post_comment START WITH parentId = 1 CONNECT BY threadId = id

Gives error: "Unexpected token 'CONNECT BY' following "", expected """

I have been on this issue for days with no progress. I'm too busy to chat via a call or session but if you could simply write up this SQL statement for me correctly and it return all the child ids based on the post/comment parentId I would gladly pay you for your efforts.

Taidot: SQL, Tietokannan hallinto, Tietokantaohjelmointi

Tietoa asiakkaasta:
( 0 arvostelua ) Las Vegas, United States

Projektin tunnus: #34739486

17 freelanceria on tarjonnut keskimäärin $447 tähän työhön

(33 arvostelua)
5.6
topithub

DB2 on Cloud: Recursive SQL statement to select all children (even grand and great grand children) ids. Hi, hope you are doing well, I am free nowadays and can start your work. For my experience kindly once have a look Lisää

$450 USD 2 päivässä
(13 arvostelua)
5.2
TEKSCENT

Hi i think so connect by dont used in Db2. Which db2 version u are working right now. I need the dummy table data and the dymmy output u want I have 13 yearsof experience in sql development and worked in more than 300 Lisää

$600 USD 600 päivässä
(21 arvostelua)
4.4
ahmedkamran9

I'm a UK based database developer/designer with over 18 years of experience in various databases, including Oracle, SQL Server, PostgreSQL and MySQL. I'm also an Azure certified data engineer with experience in the ETL Lisää

$500 USD 7 päivässä
(17 arvostelua)
4.5
liveexperts123

Hi there, I have read your project description and i'm confident i can do this project for you perfectly.I still have a few questions. please leave a message on my chat so we can discuss the budget and deadline of the Lisää

$750 USD 6 päivässä
(1 arvostelu)
3.6
merinsinha

Senior SQL expert. I can do it. As 9+ years experiences in these field. I can give good quality work. I have read the guidelines of your work.I believe that i can provide you the best quality works you are anticipatin Lisää

$500 USD 7 päivässä
(24 arvostelua)
3.8
manojmo

hi, this is a very simple requirement, worth only 30$. i have 20+ years experience on web and databases and can fix this. what os and db2 version do you use ? this oracle syntax is available only on some versions. re Lisää

$250 USD 1 päivässä
(1 arvostelu)
3.4
(5 arvostelua)
3.2
kostyrahi

Hi I am interested in your job. I'd like to discuss on private chat. Hope to hear from you. Best regards

$500 USD 7 päivässä
(2 arvostelua)
2.8
wilfrednjorog

Hi! I am skilled writer with the vast skills and qualifications necessary for this job. I have experience in SQL, Database Administration and Database Programming. I am confident that I can produce high-quality work Lisää

$250 USD 3 päivässä
(0 arvostelua)
0.0
mohamedabdelall4

Hi, I am artificial intelligence engineer with more 8 years of experience in data science & database programming Feel free to contact me for further details. Let's have a quick chat to discuss in detail. Looking forwar Lisää

$500 USD 7 päivässä
(0 arvostelua)
0.0
serhiihrechyshni

Hi, Dear. I have a lot of experience in web development. I think myself a satisfied developer for your job. I can work fulltime remotely for you. I will wait for you reply. Sincerely.

$500 USD 7 päivässä
(0 arvostelua)
0.0
EvgeniyMeshik

Greetings! i read your project details and i understood. I can help you with your project at a high level! I have rich experience in WEB developing. My skills and experience is a great match for your needs. Looking f Lisää

$300 USD 6 päivässä
(0 arvostelua)
0.0
topgradeclubltd

Hi, Greetings and hoping you are doing well, i welcome you to my profile where quality and client satisfaction is the Priority. I am Expert DOMINIC and i hope to cooperate with you on your project. CERTIFIED SQL DEVEL Lisää

$750 USD 1 päivässä
(0 arvostelua)
0.0
rchowe

Hi, Please message me and I'll get you the DB2 SQL statement you need. I'm Colorado-based but currently in Boston (Eastern Time); message me at any hour though. Thanks! RC

$250 USD 1 päivässä
(0 arvostelua)
0.0
yevhenkyslyi

Hi Dear client I have already read your requirement very carefully. I am a new freelancer, but I have a lot of experience and skills in Database like Mysql, sql, Mongodb etc. In addition, as help of powerful algorithms Lisää

$250 USD 1 päivässä
(0 arvostelua)
0.0
rameshsagg

Hi, I can help you on your Select/Delete statements. I charge $50/hr. I would require a walk through of your code before we start off. Please message me to discuss further. Thanks.

$500 USD 7 päivässä
(0 arvostelua)
0.0