Monday, 15 August 2011

How to link values in sql -



How to link values in sql -

ok have dummy question sql. have product abc , warehouse 1 how create value like: abc-1 tried 'and', &, doesn't work out. sorry if dummy question.

for mysql or sql server, can utilize concat function. utilize look this:

select concat(t.product,'-',t.warehouse) foo mytable t

for oracle, can utilize double pipe characters string concatenation:

select t.product||'-'||t.warehouse foo mytable t

for sql server, have alternative of using + operator string concatenation, if operands string types , not numeric types.

sql

No comments:

Post a Comment