Newsletter: Order phentermine cod Order xanax cod Lodine Buy Valium Brompheniramine Side effects of tramadol hydrochloride Generic viagra cialis levivia buy cheap Gatifloxacin Prozac soma Viagra online pharmacy How long does xanax stay in the system Xanax dosage Phentermine addiction help Xanax detoxification Loratadine Meridia diet pill Does it viagra work Generic uk viagra Nortriptyline What does phentermine do to your heart 5 no prescription Taking xanax while pregnant Adipex cheap phentermine Celexa Rofecoxib Cialis prescriptions Olanzapine Estrace Phentermine from canada Buy xanax Viagra dosage Miconazole Imitrex About xanax Free cialis samples Cheap 37 5 phentermine Viagra experience Long term side effects from xanax Hydrocodone guaifenesin Scopolamine Levitra vs cialis vs herbal Parnaparin Cefonicid Oxyphencyclimine Mephobarbital Xanax anxiety Cephalothin Phentermine medical insert Cialis Phentermine worldwide shipment Motrin Buy meridia online Buy Butalbital Troglitazone Cytotec Ambien cr Fast phentermine Purchase phentermine online Xanax detox Flunitrazepam Leucovorin Viagra testimonials Best price for viagra in the uk Amphetamine Viagra jokes Cheap phentermine perscription Cialis com Hydrocortisone Phentermine $89 Phentermine online purchase Colchicine Carphenazine Metoprolol Lithium Viagra experiences Viagra prescriptions online Viagra price list Cheap phentermine pills Ambien Berman sister female viagra study Crohns phentermine Amide pharmaceutical phentermine Phentermine shipped to florida Paxil and xanax interaction Viagra erection Cheap cialis Viagra best buy Clomipramine Best price viagra Anisotropine Phentermine line Pindolol Meclizine Information medical phentermine Is klonopin stronger than xanax Alternative herbal supplement viagra Buy generic viagra online Flovent Cimetidine Do companies sell phentermine with low dose ingredients Premarin Mirapex Viagra no prescription Lisinopril drug interaction viagra Generic vicodin Dioxyline Generic name online qoclick tramadol Lethal dose of xanax Purchase fioricet How to inject xanax pills Phentermine usa pharmacy Xanax cod Pentamidine Woman taking viagra Chlorzoxazone Cheep paris france phentermine Compare cialis levitra Taking viagra or levivia as a booster for cialis Spectinomycin Cialis generic viagra Get phentermine But phentermine Atarax Online viagra prescriptions Cialis commercial Pfizer viagra sperm Buy xanax without a prescription Natural alternative to viagra Low cost cialis Cialis price Prescription weight loss medication phentermine Viagra dosages Phentermine side effects Buy phentermine prescription Us phentermine Xanax for sale Mazindol 100 phentermine Cialis on line Generic cialis online Oxazepam Cefaclor Phentermine fastin Phentermine alternative Idoxuridine Xanax drug tests Phentermine insulin Penicillamine Chromium Cefixime Pantoprazole Cheap soma Maker of viagra Phentermine sales Phentermine snorting Generic purchase viagra Xanax and weight gain 5mg tablet Viagra free pill Bupropion Vinorelbine Generic viagra Cheap online phentermine prescription Piroxicam Cheap phentermine overnight Amoxicillin Viagra alternate Adipex diet discount phentermine pill Hydrocodone online Is phentermine safe Ticarcillin Cheap pharmacy viagra Naltrexone Buy Lipitor Percocet Bromocriptine Dovonex Ingredient phentermine Buy viagra internet 0 buy by popl powered viagra wordpress Comparisons on online viagra suppliers Viagra strip poker flash games Cheap phentermine free consult Phentermine and glucophage Overnight xanax Methamphetamine Inderal Hydrochlorothiazide Imodium Norflex Buy viagra online uk Somatostatin Midazolam Cialis comparison viagra 5 90 Phentermine without perscription Compare levivia and viagra Arthrotec Viagra users Xanax photo Mail order viagra online Sertraline Compare viagra cialis levitra Buy florida in phentermine Herbal viagra alternative review Ambien side effect Diethylstilbestrol Phenolphthalein Viagrafix Viagra cream Bactrim phentermine Geodon Cialis viagra Appetite suppressants and phentermine Xanax alcohol Can i buy phentermine anywhere in uk Epirubicin Viagra women Noroxin Viagra testimony Flurazepam Triamcinolone Cialis experiences Does viagra work for women Phentermine very cheap Alprazolam No prescription phentermine Xanax medication Lowest viagra price Herbal viagra for women Adipexdrug addiction order phentermine online Dangers of xanax and klonopin addiction Free shipping on phentermine diet pills Phentermine online pay with mastercard Cyclandelate Buy cialis generic online Famotidine Canadian viagra Lowest drug price for phentermine Medrol Albendazole Cialis viagra levivia Viagra sale uk Phentermine pills Cialis compare levitra Xenical hgh phentermine quit smoking detox Viagra testimonial Voltaren Mixing cocaine and viagra Valium vs xanax Side effects of xanax Neurontin Fioricet Xanax 2 mg Lowest phentermine Amoxapine Methadone xanax interaction Allopurinol Civiate generic sildenafil viagra Phentermine overnight delivery no prescription Risperdal Book hydrocodone sport Ambien sleep aid Tramadol narcotic Discount phentermine prescription Ionamin phentermine Terbinafine Phentermine shipped to tn Viagra alternative for women Plendil Ethoheptazine Diethylpropion Losec Xanax for dogs Naproxen Tramadol online pharmacy Phentermine from the uk Canadian no phentermine prescription 1 loss phentermine pill weight Bretylium Phentermine meridia xenical review Oxtriphylline Ordering phentermine Actos phentermine aciphex imitrex Viagra on line uk Norvasc Fluconazole Viagra levivia alternatives Ambien withdrawal No prescription phentermine free shipping Hydrocodone 2005 comment december leave viagra Azathioprine Fastin phentermine Drug information picture identification tramadol er bvf Zanaflex Hydrocodone bitartrate Cialis Phentermine fda Fluvastatin Nialamide Metyrosine Hydrocodone dosage Phentermine with master card Phentermine order Buy generic hydrocodone Levitra Compare phentermine price Loxapine Order fioricet online Generic viagra online Phentermine cheapest Information about viagra Buy phentermine diet pill Uk online pharmacy phentermine Cialis testimonials Online pharmacy xanax Phenacetin Alternative to viagra drug Buy viagra without prescription Lomefloxacin Pentobarbital Tramadol dosage Clonazepam Cimetidine Viagra like pill Xanax next day delivery Xanax without prescription Alprazolam Linkdomain buy online viagra info domain buy onlin Oxyphenonium Tramadol overdose Hexachlorophene Cytomel Xanax no prescription Generic overnight viagra Diet no phentermine pill prescription Oxycodone vs hydrocodone Viagra for sale online Echothiophate Celecoxib Viagra price online Dibenzepin Fenfluramine Thioridazine Recreational viagra Vasotec Reserpine Generic sample viagra Discount cialis online Tretinoin Xanax vs klonopin Meperidine Methadone Desyrel Isotretinoin Fiorinal Crestor Methylergonovine Discount xanax Order tramadol Phentermine pharmacy online consultation Dapsone Hydrocodone on line Midodrine Anisindione Meridia Online pharmacies phentermine xenical meridia Carbenicillin Pravastatin Protirelin Abacavir Drug test tramadol Carbamazepine Viagra sales online Mometasone Glatiramer Podofilox Buy cheap cialis online Viagra sample Order cialis Phentermine resident sale virginia Inject xanax Cialis versus viagra Phentermine chemical enhancement Verapamil Trifluoperazine Cialis and pomegranate interaction Guanabenz Herbal online viagra Xanax demerol morphine no prescription needed Nylidrin Chlorpropamide Free viagra order online Purchase tramadol online Buy tramadol without prescription Cheap phentermine without a prescription Azithromycin Hydrocodone side effects Buy phentermine on line Inform your doctor medication phentermine dose weight Viagra commercials Buy cialis generic Locoid Free try viagra Famvir Plicamycin Free shipping with phentermine order Xanax overnight Lamivudine Tramadol online Dulcolax Bentyl Actonel Phentermine for sale with out perscription Mirtazapine Buy Effexor Methixene Xanax online without prescription Lowest price phentermine with free shipping Chromium Xanax grapefruit Phentermine depression Lortab and xanax without a prescription Cheap tramadol online Xanax mexico Glyburide Hydrocodone m367 Information on phentermine Chlortrimeton Order generic cialis Cialis comparison viagra Alphaprodine Pharmacy phentermine sister Avalide Cheapest viagra on line Cephradine Clindamycin Tramadol hcl 50 mg tablet Alternative to viagra online Nonoxynol How to get a xanax prescription Weight loss oral hcg and phentermine Thiabendazole Viagra success story Overnight tramadol Delivered phentermine Biaxin Lynestrenol Lozol Adalat Herbal phentermine review Soma sleep Methyclothiazide Viagra cialis levitra Norepinephrine Phentermine gynecomastia Xanax tablets Didrex vs phentermine Cialis levitra viagra vs vs Buy cialis without prescription Phentermine fact Blindness cialis Cod delivered phentermine Buy cialis Amiloride Cialis purchase Recreational viagra use Prempro Buy com lvivhost online viagra Trovafloxacin 90 $89 mastercard Woman use viagra Physican's desk reference phentermine Buy tramadol cod Buy Carisoprodol Cardizem Clomiphene Methazolamide Adapalene Viagra buy in uk online Generic xanax xr Ativan xanax Aldara _achetez le viagra de levivia Decadron Viagra uses Cheap viagra order online Cheap vicodin Generic viagra soft tab Compare levivia viagra Cialis for woman Prednisone Tramadol long term use Free viagra sample before buying Ethisterone Xanax fedex overnight Overnight phentermine shipping Naprosyn Cipro How to stop taking xanax Chlordiazepoxide Phentermine 6 pm order Alesse Phentermine diet pills Edrophonium Cefotetan Suboxone Where to buy viagra online Xanax valium Olsalazine Phentermine alternatives Viagra recreational use How long xanax stays in system Purchase cialis online Xanax drug test Mixing viagra and cialis Buy no online prescription xanax Buy xanax without prescription in usa Xanax in urine Stopping xanax Lowest prices viagra Maximum dosage of phentermine Viagra pills uk Phentermine sameday overnight saturday delivery Famciclovir Norethindrone Butoconazole On line vicodin Where can i buy phentermine Dimethothiazine Vicodin cod Xanax half life Viagra 100 mg Phentermine phendimetrazine Plaquenil Femara 00 phentermine Phendimetrazine Cefixime Methantheline Xanax side effects Methotrexate Calcitriol Encainide Hydrocodone m357 Ethanol Buy Hydrocodone Ambien Thyrotropin Comparison levivia viagra Lowest price viagra Soma online Buy viagra Chlorcyclizine Pictures of xanax Dextrothyroxine Viagra cialis levivia comparison dosages Cheapest secure delivery cialis uk Xanax cash on delivery Soma addiction Gabapentin Phentermine and atkins diet Discount phentermine to florida Diprolene How viagra works Phentermine 30mg Epinephrine Generic online phentermine Cefpodoxime Dirithromycin Tacrolimus Physostigmine Yohimbe and viagra Phentermine diet pills diet pills Phentermine buy

SQL Concatenate rows from same column

0151 27 10 2007

The other day when I was helping my friend with an assignment I came across a very interesting query. Most of us might have used the SQL Concat function to concatenate from two columns in a row. That is pretty easy for eg.

SELECT CONCAT(firstname, ‘ ‘, secondname) FROM profiles;

The above SQL Statement is very easy and self explanatory.

Now, how would you write a query (or queries) where you want to concatenate elements from the same column from all the rows that have been selected? For example if you would want a list all the usernames in the table separated by a comma:

SET @usernames = “”;
--Initialize the variable usernames with an empty string.
SELECT @usernames := CONCAT(@usernames, “, “, username) FROM profiles;
-- Here all the usernames are concatenated to the usernames variable.
-- This is not our output as this will give us multiple rows, with the last row having all the usernames.
SET @usernames = SUBSTRING(@ids FROM 2);
-- Cleaning up the list by removing the comma at the beginning.
SELECT @usernames;

The above set of queries will get you all the usernames separated by comma.

This also solved one of my other problems that I was not able to solve earlier with mySQL. How would you write a query where you could have a column with Serial Number for the records? If you take a look at the above solution, this is very easy.

SET @sno = 0;
SELECT @sno := @sno+1 as SNO, username FROM profiles;

This will give you a list of usernames with Serial Numbers as a separate column.

Hope it was worthwhile reading the above :) .



Glorious Fullmoon

2259 25 10 2007

Glorius FullmoonIf you were able to see the moon on 25th / 26th Oct 2007, you should consider yourself lucky. It is the largest full moon of the century as it reaches perigee – the closes point in its elliptical orbit. On April 3 in the current year itself the full moon appeared within hours of Apogee – the farthest point in the lunar orbit, making it the smallest full moon of the year.

It is very difficult to notice the increase in the size but when I checked out it sure seemed very bright (maybe it was just the full moon effect :) ). Anyways, I thought it was something worth remembering.