SQL Querry

Results 1 to 3 of 3

Thread: SQL Querry

  1. #1
    Anil Tumati Guest

    Default SQL Querry

    I have a small problem regarding the select statement<BR>What i want is to concat the string in the select statement (something Like Grouping)<BR><BR>Let me explain using the example<BR>My Table Stru is like this<BR>Table Name : Emp ( UserId Varchar(2), Languages Varchar(2) )<BR>And the Data is like this<BR><BR>UserId Languages<BR>------------------------------<BR>Bill English<BR>Bill Chinese<BR>Bill French<BR>Alex English<BR>Alex Hindi<BR><BR><BR>I want the Result as<BR>Bill - English,French,Chinese<BR>Alex - English,Hindi<BR><BR><BR>I am Using Oracle 8.1.3, I want the result by using the Select statement only, i know how to do it with Stored Procedures and cursors, can anybody help me <BR><BR>Any Help will be appreciated<BR>Thx in advance<BR><BR>aniL tumatI<BR><BR><BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Querry

    Select distinct UserID,Language <BR>from emp <BR>where UserID="Bill" and UserID="Alex"<BR>Why do you have Varchar(2) for values which are more than 2 characters e.g.Bill=4and so on???...<BR>Also if doesn&#039;t work change " onto &#039;

  3. #3
    Anil Tumati Guest

    Default RE: SQL Querry

    I think u did not get my question let me rephrase it<BR><BR>My DataBase Table struture is as follows<BR>TableName - UserLanguages<BR>UserId Varchar2(15)<BR>Language Varchar2(15)<BR><BR>and the data is like this<BR>Bill English<BR>Bill French<BR>Bill Chinese<BR>Alex English<BR>Alex French<BR>Bob English<BR><BR><BR>What i want the result as<BR>Bill English,French,Chinese<BR>Alex English,French<BR>Bob English<BR><BR><BR>I Dont want the Data in three different records, i want to concatinate them into one single record<BR>For Eg : if they are numbers then i can user groupby and sum them into one single record, similarly i want to concatinate<BR><BR>Mr. Greg with ur querry i can get them in three different recrod, but i want them in one single record with comma seperated

Posting Permissions

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