rajmohan Posted June 29, 2007 Share Posted June 29, 2007 i am having a table like --------------------------------- s.no | field1 | field2 | field3 | --------------------------------- 1 | a | one | aa | 2 | a | two | bb | 3 | a | three | cc | 4 | b | one | dd | 5 | b | two | ee | 6 | b | three | ff | 7 | b | four | gg | --------------------------------- i want the result like ------- a ------- aa bb cc ------ b ------ dd ee ff gg ----- i wnat a query in a single line who i will right for that please help me Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/ Share on other sites More sharing options...
sushant_d84 Posted June 29, 2007 Share Posted June 29, 2007 Hey..... We need to write Two queries. one will just give u the field1 result and according to that it wil fetch data from other query ......... IF POSSIBLE CAN U GIVE ME CLUE I AM NEW to this matter but want to try Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285555 Share on other sites More sharing options...
corbin Posted June 29, 2007 Share Posted June 29, 2007 Your question doesn't make any sense >.< Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285556 Share on other sites More sharing options...
sushant_d84 Posted June 29, 2007 Share Posted June 29, 2007 Yes really it doesnt make any sense for getting answer,.... but May I know what is the way ........ how to solve tis issue Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285559 Share on other sites More sharing options...
rajmohan Posted June 29, 2007 Author Share Posted June 29, 2007 see here i gave an example please give me a solution. i want in a single query we can able right please Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285560 Share on other sites More sharing options...
rajmohan Posted June 29, 2007 Author Share Posted June 29, 2007 please tell me how to do that Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285632 Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 try this select feild3 from table name where feild3 LIKE '%a' Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285638 Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 instead of feild3 use like feild1 Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285639 Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 or ...you can try this select field3 where field1='a'; Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285648 Share on other sites More sharing options...
rajmohan Posted June 29, 2007 Author Share Posted June 29, 2007 this query will display only one record details right i want what i ask in the first one i am having more then 1000 records so i want in single query filteration Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285683 Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 why?.Use dynamic variable $a=a; select * from test where f1='$a',the result will be 1 | a | one | aa | 2 | a | two | bb | 3 | a | three | cc | Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285688 Share on other sites More sharing options...
rajmohan Posted June 29, 2007 Author Share Posted June 29, 2007 i want result like ----- field1 ----- aa bb cc ---- field1 ----- dd ee ff --- Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285785 Share on other sites More sharing options...
Yesideez Posted June 29, 2007 Share Posted June 29, 2007 Is there any logic as to why you want those results from the table? Without some form of logic I can't see how you are wanting those particular values from the table. Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285790 Share on other sites More sharing options...
rajmohan Posted June 29, 2007 Author Share Posted June 29, 2007 see i am having cities in that cities i want to list out the areas so thats why i am asking for example india has a,b,c us d,e,f uk g,h,i now ---- india ---- a b c --- us --- d e f --- uk --- g h i thats all Link to comment https://forums.phpfreaks.com/topic/57671-mysql-doubt-please-try-to-solve/#findComment-285798 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.