![]() ![]() Note that the effect of the CAST function is to change the numeric ProductID column into a varchar (variable-length character data) value that can be concatenated with other text-based values. Modify the query as follows, and re-run it: SELECT CAST(ProductID AS varchar(5)) + ': ' + Name AS ProductName The + operator can be used to concatenate text-based values, or add numeric values but in this case there’s one numeric value ( ProductID) and one text-based value ( Name), so it’s unclear how the operator should be applied.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |