Terminé

Make nested sql query like grandfather -> father -> son details query

Hello .

I have a database which have 2 columns

username and refBy

username -> its a user whose admin is refBy column

i have 3 level data

like

mdis (username) -> rajdeep (refBy)

dis (username ) -> mdis (refBy)

ret (username) -> dis (refBy)

As you can see here rajdeep is creator of mdis ,

mdis is creator of dis ,

dis is creator of ret ,

I need a query so that if i fetch rajdeep records it will give details mdis , dis and ret alongs with its creator , its like grandfather details , if i select grandfather name it will give all his son and son of son details along with father name .

I tried this query "select username,refBy from refByTmp where refBy in (SELECT username from refByTmp where refBy='rajdeep') or refBy='rajdeep'"

But its showing only 2 level data .

*Milestone will be released only after getting working query*

I have also attached sample database

Compétences : Programmation de bases de données, MySQL, SQL

en voir plus : nested queries in sql w3schools, types of subqueries in sql, sql subquery join, sql subquery in select, subquery in sql w3schools, sql multiple subqueries in select statement, sql nested select join, sql subquery multiple tables, colouring pictures father son holy spirit, father son holy spirit color sheets, father son holy spirit coloring pages, father son holy spirit color page, free coloring books god father son holy spirit, god father son holy spirit coloring page, coloring page father son holy spirit, make ms sql filter, make php sql site mobile, uk car make model sql database, pencil drawing father son, animation father son

Concernant l'employeur :
( 34 commentaires ) Hazaribagh, India

Nº du projet : #18990529

Décerné à:

frlncrsZviDAyqG

Hello Firstly although select sub queries as per your example could be used for this solution, they are extremely inefficient and on larger datasets will almost certainly overload mysql resources and/or processing t Plus

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% INR en 1 jour
(2 Commentaires)
1.4

25 freelance font une offre moyenne de ₹1278 pour ce travail

anshulikabansal

Hello Sir, I have understood your requirement of nested SQL statement. I can provide it to you and show you at my localhost also. Looking forward for your reply. Thanks & Regards, Anshulika Bansal

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 0 jours
(37 Commentaires)
5.0
PATechnology

Hi, I am interested in the task and can do it. please ping me to discuss more. thanks.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(26 Commentaires)
4.4
sreenivas2903

Hi i already have the query and need to chnges a se per ur requirement if u can able to give sample db i will do chnges and gice u the query Ping me if u r interested

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(10 Commentaires)
4.1
WynandDuToit

Good day I have been developing just the query you describe. I just use it in a different environment. Mine is a tree structure for accounting line items. Will adjust and deliver to you!

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(1 Évaluation)
3.0
HKaraarslan

Hello, Using nested Select is much complicated for this case. You need to use joins. I created the sample table, and get the result as you want: mdis,dis,ret But I tried this on MsSql. I think the logic must b Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(2 Commentaires)
3.2
baidyamadhu007

I am a Php developer.I also expert in wordpress.I have been worked during 11 yrs in Jquery/Javascript and core php also.I have been worked on that field during 11 years of experience with that filed. I am able to ma Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 0 jours
(3 Commentaires)
3.3
naveenrgowdackm

I went through the requirement and It can be done using nested query I can quickly help you and release the milestone once done

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(5 Commentaires)
3.0
estebansalpeter

Hello, I've done many of these kind of 'nested' queries, or autoreferenced tables if you like. Working with families tables, as well as payroll formulas which reference one another. Please feel free to contact me, I' Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(1 Évaluation)
3.1
jayantavkumar

I am a database architect and having more than 14 years of experience in IT industry. I can help you to derive the sql query. Let me know if you want to discuss further. My Technical background • A goal-oriented Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(3 Commentaires)
1.8
i4ConsultantDev

Hi, I am writing this after reviewed your project description and attachment. I am interested in your project and Kindly drop a message so we can discuss. • Overall 7+ years of experience in Software Development Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 0 jours
(1 Évaluation)
1.7
kb0018896

hi i have worked on such query earlier when my project was for multi-level marketing. i can write this script. lets connect. award me the project only after the query is working.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(4 Commentaires)
1.4
techwrappers

Hello there, Gone through your details and after reading over your application this looks like a perfect fit for my skill sets!! I am a Database programmer with 12+ yrs of experience, I am having a good project Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
ernehasingh478

I am a PHP developer working with HTML, CSS, JAVASCRIPT, PHP, Codeigniter and JQERY and laravel. My competencies include PHP, Codeigniter, APIs, HTML, CSS, JAVASCRIPT, PHP, JQERY, AJAX1 and MYSQL.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
Papuas64

Hi! I made a query for you. For the case when you have 3 levels I can not attach to the application. Get into contact with me.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
3.0
EnamulHoque007

Dear Hiring Manager, I have read your problem and I'm willing to solve your problem if you give the chance. Hope you will give me the chance.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
ganeshbmali

I can finish this..........................................................................................................................................................................

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
puneet1011

Just started as a freelancer. Can help you with your problem. having 2+years of experience. looking forward to discussing with you.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
ratiniketan

Hi , I am new to freelancer. but having more than 6 years experience in php mysql project.I can solve your query.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
mohittanw

Hi, I am an full stack developer with expertise in many software technologies, .Net , MSSQL and databses.I have an experience of 5 year and counting and I am looking forward to work on your project because i found Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
tinutini

Please message me. We can discuss for fix price per package. Please review my profile. https://www.freelancer.com/u/vw7590795vw.html I have 9 years experience in MS SQL Server. Please let me know more details and w Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0