I need a sql wizard who can rewrite my query.
At the moment this query works for single records, exactly how i want.
But what i want is to return multiple rows formated like now.
DELIMITER |
DROP PROCEDURE IF EXISTS getForumNameAndPermission |
CREATE PROCEDURE getForumNameAndPermission()
BEGIN
DECLARE forum_name VARCHAR(255);
DECLARE permission VARCHAR(255);
SELECT [login to view URL] AS ForumCategory INTO forum_name FROM Node
LEFT JOIN field_data_body ON [login to view URL] = field_data_body.entity_id
LEFT JOIN taxonomy_index ON [login to view URL] = [login to view URL]
LEFT JOIN taxonomy_term_data ON [login to view URL] = [login to view URL]
where type = 'conversation' and [login to view URL] = 112 LIMIT 1,1;
SELECT [login to view URL] AS Permission INTO permission FROM Node
LEFT JOIN field_data_body ON [login to view URL] = field_data_body.entity_id
LEFT JOIN taxonomy_index ON [login to view URL] = [login to view URL]
LEFT JOIN taxonomy_term_data ON [login to view URL] = [login to view URL]
where type = 'conversation' and [login to view URL] = 112 LIMIT 1;
SELECT [login to view URL], field_data_body.body_value, forum_name,permission FROM Node
LEFT JOIN field_data_body ON [login to view URL] = field_data_body.entity_id
LEFT JOIN taxonomy_index ON [login to view URL] = [login to view URL]
LEFT JOIN taxonomy_term_data ON [login to view URL] = [login to view URL]
where type = 'conversation' and [login to view URL] = 112 LIMIT 1;
END |
CALL getForumNameAndPermission();
What this query do, is returning single row with [login to view URL], field_data_body.body_value, forum_name,permission columns with [login to view URL] = 112. thing is that Taxonomy term data ForumCategory, and taxonomy term data Permission, have the same [login to view URL] number, and by default this is resulting in 2 rows for single result, where Permission is under Forum Category in same column. And i need for them separate columns in one row.
My prepared statement works partially because, its return for me only single result. thing is that i want to return more rows with other nids that exists: [login to view URL], field_data_body.body_value, forum_name,permission columns with [login to view URL] that come from db, with type ='conversation'.
I don't know why taxonomy_index crossing everything like that. I've tried to use Counter from prepared statement, init the loop with Minimum nid till Maximum nid, but ive still get only one record, or errors. [login to view URL] = counter didn't work.
I use MySQL db
I have worked with very complex queries among several tables, both to create views and stored procedures. I will make sure everything is working properly and I'll communicate constantly with you.
Stay tuned, I'm still working on this proposal.
$15 USD w 10 dni
5,0 (1 opinia)
2,0
2,0
15 freelancerzy składają oferty o średniej wysokości $31 USD dla tej pracy
Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. I can do this task as per your requirement
Relevant Skills and Experience
I have the 5 years of experience with excellent knowledge. please give me a chance to work on your project
Proposed Milestones
$70 USD - payment after work completion
Hi, i think i have understood the issue. i excellent understanding of SQL queries. If you let me access your database, i'll be able to provide the solution or confirm feasibility of your requirement.
Relevant Skills and Experience
MySql, SQL
Proposed Milestones
$20 USD - Rephrase the query to get desired output
Hi! I'm experienced back-end developer from Ukraine. I have a lot of skills and able to help you to solve almost any issue you are faced with. Feel free to connect me for discuss
Hi I hope you have an amazing day.
I am good in MySql.
If you give me a chance I will not let you down.
Relevant Skills and Experience
I worked on multiple MySQL projects.
I have worked on complex databases.
Proposed Milestones
$10 USD - you will get multiple rows and you will be satisfied and i will not let you down.
here i can do this task i have recently graduated i have done bachelore in computer sciences
Relevant Skills and Experience
c++.c# my sql java querry phython expert
Proposed Milestones
$111 USD - i will deliever you quality work and delievered you with in the time period
I'm two years experienced web developer, I've worked with php, mysql and javascript mainly. I've worked on large websites and on mobile apps APIs. I'm just starting my freelance career, I do care on first place about the quality of my work and the rating of my account. If you hired me I'd afford you the best work quality.
looking forward to hearing from you.
Regards,
Noha
Hello,
I( from, Meticulous Technologies Solutions) can make this work perfectly done.
We are 13 years in the I.T. industry.
Please let me know more details of this work.
Thanks.
Relevant Skills and Experience
Website design
Mysql
I am a DBA and work as Database Administrator and SQL developer.
I understand your requirement and can convert this SQL easily to return all avalaible record for node or even set of nodes
Relevant Skills and Experience
SQL Developer - Exp 9 years
DBA(MYSQL/PostgreSQL) 6 years
Proposed Milestones
$25 USD - SQL Re-writing