SQL Query to combine to text fields

Nov 02, 2005 5 Replies

I want to run a query that will append the Item.SubDescription1 field to the Item.Description.



Something like this: UPDATE Item SET Description = Description + ", " + SubDescription1



Is this possible? What would be the proper syntax?



Thank you, Tom


Tom,

UPDATE i SET Description = SUBSTRING(i.Description + ', ' + i.SubDescription1, 0, 31) FROM Item i

- Evan Culver New West Technologies

Terrible Tom wrote:

Thank you, Mr. Culver.

I presume that "i" represents a specific item in the example you provided. If I use "Item" where you have "i" will this query update all items?

I'm hoping to apply this to every item in my database

Thanks aga> Tom,

Tom,

In the query it says "From Item i," which means that wherever there's an "i" it means item. So the "i.*" means "Item.*" Just a shortcut, that's all.

Hope this helps,

Matt

Tom,

That query will update every item in your database -- 'i' is just used as an alias for the 'Item' table.

- Evan Culver New West Technologies

Terrible Tom wrote:

It worked! Thanks for the help.

Tom

"Evan Culver" wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required