![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 3 Pomógł: 0 Dołączył: 15.01.2015 Ostrzeżenie: (0%) ![]() ![]() |
Witam wszystkich, potrzebuje pomocy przy bazie danych.
Mam trzy tabele: categories category_id | name | description 1;New;Opis categories_items id | categoryId | itemId 1;1;1 2;1;2 3;2;1 items item_id | name 1;New Product Chciałbym uzyskać coś takiego item_id | name | categoryId (grupowanie z seperatorem ,) 1;New Product; 1,2 Proszę o pomoc przy zapytaniu (IMG:style_emoticons/default/smile.gif) |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 3 Pomógł: 0 Dołączył: 15.01.2015 Ostrzeżenie: (0%) ![]() ![]() |
Jednak, działa tylko musiałem dodać USING utf8. Bardzo dziękuje (IMG:style_emoticons/default/smile.gif)
SELECT i.item_id, i.name, CONVERT(GROUP_CONCAT(c.categoryId SEPARATOR ', ') USING utf8) `categoryId (grupowanie z seperatorem ,)` FROM items i join categories_items c on c.itemId=i.item_id GROUP BY 1,2 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 14.10.2025 - 03:43 |