Follow below steps :Suppose My Table create table data (   ...> id int,  
...> countryid int,   ...> state varchar(30)     ...> );Insert Query
------------------------------------sqlite> INSERT INTO data 
VALUES(56,9,'true');sqlite> INSERT INTO data  VALUES(56,54,'true');sqlite>
INSERT INTO data  VALUES (57,2,'false');sqlite> INSERT INTO data 
VALUES(57,9,'true')Now Pivot Query
---------------------------------------*SELECT  id,
GROUP_CONCAT(countryid,state) AS 'state' FROM data  GROUP BY id;*



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Howto-pivot-in-SQLite-tp26766p79850.html
Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to