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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
corbin Posted June 29, 2007 Share Posted June 29, 2007 Your question doesn't make any sense >.< Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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' Quote Link to comment Share on other sites More sharing options...
suma237 Posted June 29, 2007 Share Posted June 29, 2007 instead of feild3 use like feild1 Quote Link to comment 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'; Quote Link to comment 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 Quote Link to comment 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 | Quote Link to comment 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 --- Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.