0

i am still learning SQL. I have the following table DeviceType

|shopName|Device
---------|-----------
|Shop1   |app1
|Shop1   |app2
|Shop1   |sam1
|Shop2   |app67
|Shop3   |app82
|Shop3   |sam028

i am trying to get the following result

Shop1|app1|app2|sam1
Shop2|app67
Shop3|app82|sam028

my code is as follows:

select Shopname,(SELECT device FROM DeviceType where left(SNTxReference,3)='app'     )
from DeviceType

but i get Subquery returned more than 1 value

jarlh
  • 42,561
  • 8
  • 45
  • 63
Tinashe
  • 65
  • 8

0 Answers0