For example here, from this table key | status 1001 | A 1001 | D 1001 | C the hierarchy will be C>D>A If the the stats contain C as the value, the person status will become C in one row. …
Tag: concatenation
SQL – concatenate strings in variable while loop with +=
I can’t concatenate in this example bellow! When I loop I get my 2 correct results. When I concatenate @MaterialCompositionEn += ‘, ‘ it works fine When I try to concatenate @MaterialCompositionEn += same query to get the 2nd row, I have a null! Result: Now when I change to: I am expecting 2…
concatenate with leading zeros for months – not a valid month error
I want to concatenate string with year in oracle. The string is month. Query is This query wrks fine however if the string is ’01’ or anything starting with zero i am getting not a valid month error. Answer Let’s run it without the to_date(…, …) wrapper: Do you see the problem? (…
Creating a “specific” form of XML, without string concatenation in SQL server T-SQL
I have some weird requirements that demand a specific XML format. Due to short deadlines and my lack of skills I decided to do a fast solution where I generate the XML through string concatenation. and this gives the output which I need. However, I’ve been told numerous times that this is not best pract…
Grouping other fields by common email
I’d appreciate any assistance people could provide with this one. I’ve tried to follow a couple of other posts (GROUP BY to combine/concat a column), but when I do this, it combines everything. I …
Access VBA update a column to concatenate
I was trying to update a column from a table in my Access database with following VBA code but it did not work as nothing happpened to that column. I would like to concatenate 5 columns into one. This update statement would work in SQL server but obviously not here. Any advice? Thanks. Answer Perhaps some fie…
SQL using If Not Null on a Concatenation
If I have the table SELECT (Firstname || ‘-‘ || Middlename || ‘-‘ || Surname) AS example_column FROM example_table This will display Firstname-Middlename-Surname e.g. John–Smith Jane-Anne-Smith …
Set column to a concatenated value from another table
I have 2 tables in SQL Server 2008: Address: nameid | e-mail ————— 1 | xyz@abc.com 2 | fgh@asdf.com 3 | 123@doremi.com Member: nameid | memberid ————— 1 | …
MySQL concatenation operator
I don’t know concatenation operator for MySQL. I have tried this code for concatenation: SELECT vend_name || ‘ (‘ || vend_country || ‘)’ FROM Vendors ORDER BY vend_name; But it didn’t work. Which …
Concatenate records and GROUP BY in Access
I have a table like this: title part desc Blah This 1 This begins the Blah This 2 example table. Some …