2 Replies - 7717 Views - Last Post: 23 April 2011 - 05:12 AM

#1 TechDee  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 21-May 10

Concatenate with a value in parenthesis -- sql query

Posted 27 March 2011 - 03:49 PM

I'm using a query to display the movie number, and movie description for all movies where the movie description is combination of the move name, movie year, and movie genre with the movie year enclosed in parentheses.

I got this far.... Question how to implement parenthesis for each movie year

SQL> SELECT MOVIE_NUM,MOVIE_NAME||' '||MOVIE_YEAR||' '||MOVIE_GENRE AS MOVIE_DESCRIPTION
FROM MOVIE;

MOVIE_NUM      MOVIE_DESCRIPTION
--------------------- ------------------------------------------------------
1234          YOUR THE MAN (2009) FAMILY
2333          THANK YOU (2011)  ACTION




Is This A Good Question/Topic? 0
  • +

Replies To: Concatenate with a value in parenthesis -- sql query

#2 Hary  Icon User is offline

  • D.I.C Regular

Reputation: 44
  • View blog
  • Posts: 427
  • Joined: 23-September 08

Re: Concatenate with a value in parenthesis -- sql query

Posted 23 April 2011 - 04:10 AM

I don't understand the result you want to create. Could you give an example of the result table you'd like to produce?
Was This Post Helpful? 0
  • +
  • -

#3 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: Concatenate with a value in parenthesis -- sql query

Posted 23 April 2011 - 05:12 AM

The output you post it is what you want to achive? If so, change the query as
SELECT MOVIE_NUM,MOVIE_NAME||' ('||MOVIE_YEAR||') '||MOVIE_GENRE AS MOVIE_DESCRIPTION
FROM MOVIE;


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1