www.webdeveloper.com
Results 1 to 4 of 4

Thread: Multi query

  1. #1
    Join Date
    Feb 2012
    Posts
    33

    Multi query

    Hello Everyone

    Im looking for solution to make query.
    This is example table.
    |link|token|
    |link1|1234|
    |link2|1234|
    |link3|5678|
    |link4|5678|


    I wanna to select links and connect it in result where is the same token:
    For example first result:
    token1
    link1
    link2

    second result:
    token2
    link3
    link4



    Could you show me good way, give little advice??
    thanks for response

  2. #2
    Join Date
    May 2004
    Location
    chennai, tamil nadu, India
    Posts
    445
    A very crude sql statement which may WORK *ONLY* in this case and *ONLY* for this particular data could be something like this


    Code:
    SELECT t1.token, t1.link, t2.link
    FROM exampletable AS t1 ,  exampletable AS t2  WHERE t1.link <> t2.link AND t1.token = t2.token group by t1.token
    Chris, Senior Developer,
    Php laravel developers,
    www.chrisranjana.com

  3. #3
    Jgy3183 is offline Web Applications Develope
    Join Date
    Mar 2009
    Posts
    29
    You could use a cursor to loop through your first table to select the deisred recordsets.

  4. #4
    Join Date
    Oct 2009
    Posts
    658
    What platform? In MySQL there is group_concat
    Good Luck

    Santos Systems

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles