Составить SQL запрос
нужно составить запрос
Есть 3 таблицы
первая - список товаров - product
product.product_id
product.product_name
вторая - таблица названий атрибутов - attribute_description
attribute_description.attribute_id
attribute_description.name
третья - таблица прнадлежности атрибута к товару - product_attribute
product_attribute.product_id
product_attribute.attribute_id
нужно вывести товары с атрибутами и их названиями в одной стоке, у меня 4 товара, тоесть должно получится 4 строки
-
798 15 0 Приветствую.
Могу помочь с заданием.
Напишу скрипт за 10 минут.
Для быстрой связи Telegram: @gmastrbit
https://t.me/gmastrbit
-
759 4 0 Готов написать запрос на MySQL,или SQL. Обращайтесь, сделаю.
-
250 37 1 2 Готов написать для вас это sql запрос.
Готов написать для вас это sql запрос.
-
1 day1 USD
2109 226 0 1 1 day1 USDДобрый день! Напишу запрос в одну строку, только уточните какая база данных у вас
-
2073 116 0 Добрый день! С легкостью составлю SQL запрос, делал подобное огромное количество раз. Работы на 5 мин. Обращайтесь!
-
93 5 0 1 Готов написать для вас это sql запрос. Обращайтесь, могу приступать!
-
355 10 4 1 Добрый день. Знаком с sql и сложными запросами. Сделаю за 20 минут.
-
))) Делаете процедуру(функцию) для вывода в 1 строчку атрибутов с входным параметром товара, а потом уже и запрос. Но лучше все сразу сделать в процедуре и выводить нужный результат
-
по сути реализовал на mysql одной строкой для каждого товара
product_name group_concat(a.name) груши цвет,вес сливы вкус,цвет яблоки вкус,цвет,вес product_id product_name 1 яблоки 2 груши 3 сливы attribute_id name 1 вес 2 вкус 3 цвет product_id attribute_id 1 1 1 2 1 3 2 1 2 3 3 2 3 3 -

На Oracle можно так
select
p.product_name,
listagg(ad.name,',') within group (order by ad.name) as attribute_name
from
product p
inner join product_attribute pa on pa.product_id = p.product_id
inner join attribute_description ad on ad.attribute_id = pa.attribute_id
group by
p.product_name
На mysql вроде так:
select
p.product_name,
group_concat(ad.name separator ',') as attribute_name
from
product p
inner join product_attribute pa on pa.product_id = p.product_id
inner join attribute_description ad on ad.attribute_id = pa.attribute_id
group by
p.product_name
-
Current freelance projects in the category Databases & SQL
Need a Power BI specialist to build management reporting based on BAS Accounting CORPAbout the CompanyWe are a distributor of international sports brands in Ukraine. Accounting is maintained in BAS Accounting CORP.We are looking for a specialist who can help build a management reporting system for the company's management based on Power BI.Important: we are… Databases & SQL, Accounting Services ∙ 2 days 6 hours back ∙ 4 proposals |
Technical task: Integration of Telegram chatbot with BAS1. General Description It is necessary to implement the integration of the chatbot with the BAS system for the transfer and recording of data about products (orders). 2. Input Data (sent by the chatbot): Group ID Product name (with product code) Product price 3. Logic of… Enterprise Resource Planning (ERP), Databases & SQL ∙ 2 days 9 hours back ∙ 18 proposals |
1C data integrationOrganize quality preparation and data transfer from 1C to BigQuery for further use in Looker:Organize the data according to the required fields.Prepare a clear structure of tables and intermediate datasets on which dashboards will be built.Set up data loading, gather key… Databases & SQL, Data Processing ∙ 4 days back ∙ 9 proposals |
Development of a simple controlling and management record system in Google Sheets "turnkey"Task name: Development of a simple controlling and management record system in Google Sheets "turnkey" for a construction company in Poland (+ online training and implementation assistance) About the company, context, and my main problem Hello, I am looking for an experienced… Databases & SQL, Accounting Services ∙ 5 days 6 hours back ∙ 36 proposals |
Development of an analytical Power BI dashboard
45 USD
This is our request, we need a person who understands Power BI: Screen 1: Strategic Cockpit (Financial Health of the Plant) Goal: To understand in 5 seconds, "where are we losing money and how much?". KPI Tiles (Top Bar): Overall margin (Actual vs Plan) in %. Amount of "lost… Databases & SQL ∙ 5 days 9 hours back ∙ 13 proposals |