- Posts: 210
- Thank you received: 3
Custom field SQL select from two columns
- Patrick
- Topic Author
- Offline
- Elite Member
Less
More
5 years 6 months ago - 5 years 6 months ago #117587
by Patrick
Custom field SQL select from two columns was created by Patrick
Hello
I use a custom field of type SQL. There I use this statement:
This works fine. Now I need to get the data from column name_kind_2 as well. So I try:
But this gives me value of name_kind_2 only. How can I get all data?
Thank you very much.
Patrick
I use a custom field of type SQL. There I use this statement:
Code:
SELECT name_kind_1 AS value, name_kind_1 AS text FROM #__jsn_users WHERE id = [USER_ID]
This works fine. Now I need to get the data from column name_kind_2 as well. So I try:
Code:
SELECT name_kind_1, name_kind_2 AS value, name_kind_1, name_kind_2 AS text FROM #__jsn_users WHERE id = [USER_ID]
But this gives me value of name_kind_2 only. How can I get all data?
Thank you very much.
Patrick
Last edit: 5 years 6 months ago by Patrick.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
5 years 6 months ago #117610
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom field SQL select from two columns
Hi Patrick
It depends on how you want to get data. I guess you can use mysql CONCAT_WS function from mysql to return the value of two fields to use dev.mysql.com/doc/refman/8.0/en/string-f...l#function_concat-ws
Tuan
It depends on how you want to get data. I guess you can use mysql CONCAT_WS function from mysql to return the value of two fields to use dev.mysql.com/doc/refman/8.0/en/string-f...l#function_concat-ws
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.