| От | NRonayette |
|---|---|
| Тема | Re: SQL question |
| Дата | |
| Msg-id | 3969C13F.68F1506E@socotec.fr обсуждение исходный текст |
| Ответ на | SQL question (Travis Bauer <trbauer@indiana.edu>) |
| Список | pgsql-general |
Travis Bauer a écrit : > > Is it possible to return a column in an sql statement which concantenates > two other columns and adds some other characters. For example: > > create table t1 (x int, y int); > insert into t1 values(1,2); > select ???? as nifty from t1; > > nifty > ----- > 1/2 > > What should I put in for the ???? ? select t1.x||'/'||t1.y from t1; this should work. If you can't concatenate int with char (t1.x with '/'), you must use a function to convert int in char If "to_char" is the name of this function, ???? became : to_char(t1.x)||'/'||to_char(t1.y) Nicolas
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера