Re: [sqlite] Select Multiple rows in one row

2011-10-15 Thread Simon Davies
On 15 October 2011 12:20, Madhan Kumar  wrote:
> Hi.
>
>    I have two Tables with the follwing structure
>
> *EmpTable*
>
> Empid* * Empname
>
> 1        * Raja *
>
> 2        Kumar
>
> *DeptTable*
>
> Deptid    Deptname    Empid
>
> 101   * xxx*     1
>
> 102     *yyy*    1
>
> 103    *zzz*    1
>
> 104    bbb    2
>
> 105    ccc    2
>
> i need a Sqlite query to display the data in one row (concatenate the
> deptdetail rows in one row instead of 3 rows)
>
> Empid    Empname     DeptDetail
>
> 1    Raja   * xx - yy-zz*
>
> 2     Kumar     bbb-ccc
>
> Thanks

http://www.sqlite.org/lang_aggfunc.html#groupconcat

Regards,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Select Multiple rows in one row

2011-10-15 Thread Madhan Kumar
Hi.

I have two Tables with the follwing structure

*EmpTable*

Empid* * Empname

1* Raja *

2Kumar

*DeptTable*

DeptidDeptnameEmpid

101   * xxx* 1

102 *yyy*1

103*zzz*1

104bbb2

105ccc2

i need a Sqlite query to display the data in one row (concatenate the
deptdetail rows in one row instead of 3 rows)

EmpidEmpname DeptDetail

1Raja   * xx - yy-zz*

2 Kumar bbb-ccc

Thanks
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users