-1

data in tables like below..

col1    col2   col3

100      700     500

100      700     501

100      700     502

101      701     503

101      701     504

101      701     505

Suppose user enter col1 = 100 and click search then it display like below in single row...

col1       col2          col3

100        700           500,501,502

I need sql query which select all col3 value and display in single Row.

plz help me to get this....

Tushar
  • 3,527
  • 9
  • 27
  • 49
sunil satpute
  • 111
  • 1
  • 3
  • 14

1 Answers1

-1
SELECT
  col1,
  col2,
  GROUP_CONCAT(col3) as col3
FROM
  table1
WHERE 
  col1=100
GROUP BY col1,col2
Alex
  • 16,739
  • 1
  • 28
  • 51