![]() |
Simple query help please
I've been wondering if I could do the following with a query, as opposed to using php.
I have two profile fields, `field1` and `field15` which each have strings within (or may be empty). What I want to do is pull the info from field1, and append it to that within field 15. This is quite simple to do via php & mysql, but is it at all possible to do with only a query? |
if field1 = 'abc' and field2 = 'def'
Code:
select concat(field1, field2) as letters |
thanks siradrian - perhaps I should have been clearer though, what I meant was doing it with one UPDATE query, in other words updating the actual database field15, not just selecting it :)
|
That would be almost the same:
[sql]UPDATE table SET field15 = CONCAT(field1, field2) WHERE condition if needed [/sql] |
All times are GMT. The time now is 05:25 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|