SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to insert Quotes, Pipes, %, IS, IN, LIKE, bracket and variables in Concatenated S

    Hi,
    Can someone please recommend a book or links to articles where I can learn how to insert Quotes, Pipes, %, IS, IN, LIKE, bracket and variables in Concatenated SQL query string literals?

    I donít know the syntax to write statements with string literals.

    Thanks

  2. #2
    SitePoint Zealot
    Join Date
    May 2005
    Location
    Suwanee GA
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you looking for something like this?

    Code SQL:
    SELECT 'region and store is ' +region_name + '|' + store_name AS regstore

    If so, syntax may vary between databases. Also review concat() or use of ||

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,265
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    i should just like to point out that the plus sign is used for string concatenation only in a very small number of database systems

    database systems that follow sql standards use the double pipe (||) for concatenation
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by esearing View Post
    Are you looking for something like this?

    Code SQL:
    SELECT 'region and store is ' +region_name + '|' + store_name AS regstore

    If so, syntax may vary between databases. Also review concat() or use of ||
    Thank you for the reply. I am exactly looking for what you have. I am using MYSQL, Java and JAVASCRIPT and I want to learn how to write statements.

    Thanks

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,265
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    in mysql use the CONCAT function
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •