i'm having a problem on my query, this is the working query and      SELECT res_ID,res_fName,res_mName,res_lName,rs.suffix,rms.marital_Name,rg.gender_Name,rr.religion_Name,ro.occupation_Name,ros.occuStat_Name,res_Date_Record,rc.country_citizenship,res_Bday,TIMESTAMPDIFF(YEAR,res_Bday,CURDATE()) AS age, (case    when (TIMESTAMPDIFF(Month,res_Bday,CURDATE())&lt;=1) then 'Maternal and Newborn'  when (TIMESTAMPDIFF(Month,res_Bday,CURDATE())&lt;=1 and TIMESTAMPDIFF(Month,res_Bday,CURDATE())&lt;=12) then 'Babies' when (TIMESTAMPDIFF(Month,res_Bday,CURDATE())&lt;=13 and TIMESTAMPDIFF(Month,res_Bday,CURDATE())&lt;=24) then 'Toddlers' when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=2 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=4) then 'Preschoolers'  when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=5 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=8) then 'School Age Children'  when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=9 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=12) then 'Tweens ' when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=13 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=19) then 'Teenager' when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=20 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=35) then 'Young Adult' when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=36 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=55) then 'Middle-Aged Adults' when (TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=56 and TIMESTAMPDIFF(Year,res_Bday,CURDATE())&lt;=100) then 'Senior'    end) Age_Stage FROM resident_detail rd  LEFT JOIN ref_suffixname rs ON rd.suffix_ID = rs.suffix_ID  LEFT JOIN ref_gender rg ON rd.gender_ID = rg.gender_ID LEFT JOIN ref_marital_status rms ON rms.marital_ID = rd.marital_ID LEFT JOIN ref_religion rr ON rr.religion_ID = rd.religion_ID  LEFT JOIN ref_occupation ro ON ro.occupation_ID = rd.occupation_ID  LEFT JOIN ref_occupation_status ros ON ros.occuStat_ID = rd.occuStat_ID LEFT JOIN ref_country rc ON rc.country_ID = rd.country_ID   this is the Result:   i want is use the alias "Age_Stage" column on WHERE statement, on the image above Age_Stage has their specific value, i just want is to filter those Age_Stage by value that i want.  but when i add on the query  WHERE Age_Stage = "Young Adult" on the of query the error is result is     Unknown column 'Age_Stage' in 'where clause'
SELECT name, gdp/population as capita  FROM world w1  WHERE continent = 'Europe'       AND capita &gt;  (     SELECT gdp/population      FROM world      WHERE name = 'United Kingdom' );   How come I can't refer to capita in the WHERE clause? It returns this error:  Unknown column 'capita' in 'where clause'   I can however, run the query if I replace capita with gdp/population.  I don't want to do gdp/population &gt; .... How can I do capita &gt; ...? Or is this not possible?
In C#/VB.NET/.NET, which loop runs faster, for or foreach?  Ever since I read that a for loop works faster than a foreach loop a  I assumed it stood true for all collections, generic collections, all arrays, etc.  I scoured Google and found a few articles, but most of them are inconclusive (read comments on the articles) and open ended.  What would be ideal is to have each scenario listed and the best solution for the same.  For example (just an example of how it should be):   for iterating an array of 1000+ strings - for is better than foreach for iterating over IList (non generic) strings - foreach is better than for   A few references found on the web for the same:               [Edit]  Apart from the readability aspect of it, I am really interested in facts and figures. There are applications where the last mile of performance optimization squeezed do matter. Meaning of telegraph code in the song "Planetes" The song Planetes in Guilty Crown begins with some telegraph encoding, which I think is . Here is the . My transcription is: -•-• -••-- •-- --•-- •- --•-• •-•-- -•--•  which decodes to this:  ni-yu-ya a-i-shi-te-ru  Niyuya didn't make sense. Did I get something wrong? Will be flying with easy jet and was wondering for retuning flights the old luggage tag we have on are suitcase. should we take them off before arriving at the airport to return home or leave it as the person will do it for us anyways? Im guessing even at self check in they will have someone who will make sure that old tags are taken off and that the new one is correctly done etc? Preprocess categorical variables with many values Human & Alien captured, observed by higher beings From a collection of short stories I read at least 30 years ago. :/  This is going to be incredibly vague, so apologies in advance.  A human and alien (blob/octopus-like...I think) from warring races are captured by an unidentified higher intelligence and put in an enclosure (more like a zoo habitat rather than a prison cell). They are separated by an invisible barrier and can see each other.  I think they were both trying to escape or trying to figure out how they could kill the other first. There was a bulldozer/loader type vehicle they could use at one point to build a shelter (or something).  I believe they were crafting makeshift weapons as well. There was no communication between the two as far as I remember.  The main tension in the story seemed to be was the race to get to the other first.  This has been stuck in my head forever. I know its a very common theme.  The short stories may have included Asimov. How do I install fonts? Question says it all. I need them to be available in gimp. How to set up USB for Virtualbox? They agreed to stay connected for hours in their provisional support group, looking for answers in their counterparts.   I want to change the bold part to say that they all shared the same problem.  Might end up using one of the above, but I feel like I need some more options to weigh in.    Edit for context: they all share the same rare cognitive impairment Search among posts you've voted for Related posts:    These posts are different from mine in that they merely ask for the &quot;votes&quot; tab back or ask if it is at all possible to get such information, while I propose how to implement this as a search feature. Background I recently found myself facing a problem very similar to one that I had solved before. I remembered that I found the solution on SO and I remembered upvoting the post containing the solution. I wasn't able to find that particular post by just searching with relevant keywords. It would have been nice if I could search only among the questions I have voted on. I searched on meta and found that there had been a tab for looking at what you've voted on, but that it was removed due to lack of interest. This is understandable, since just listing the hundreds/thousands of posts you've voted on isn't particularly useful. Proposal What I want is to be able to search for posts I've voted on similarly to the way I'm able to search on my posts within a specific tag. For instance: user:310121 [iphone] apple  This will return all my posts tagged iPhone, where I mention Apple. This is brilliant. This is just how I want search to work. Now what I want to do is to extend this to include votes. The exact syntax isn't relevant, but I had to make one up to show you what I mean: To show all posts you've voted on: user:310121 {votes}  To show all posts you've upvoted: user:310121 {upvotes}  To show all posts you've downvoted: user:310121 {downvotes}  You could probably omit the the user part, since you're only allowed to see your own votes. (Unless it's desirable to be able to look at other peoples votes. Maybe you should be allowed to do this if you have enough rep? Well, that's another discussion.) I guess that even if you're allowed to see other peoples votes it would make sense to display your own votes if the user part is omitted. So in my case I could have done the following search and found the post I was looking for: {upvotes} keyword  Lastly I just want to suggest that clicking on your vote count will work just like clicking on a tag. If I click on a tag in my profile the following search will be done: user:310121 [tag]  So if I click on my upvote count the following search should be made: user:310121 {upvotes}  The same goes for downvotes: user:310121 {downvotes}  This would be a very useful feature and it wouldn't be intrusive in any way. The users that don't care for this feature might never know that it's there. And just for the record the favorite system doesn't replace this feature. What happens to the Windows 7 key when upgrading to Windows 8? Microsoft is offering "Microsoft Windows 8 Professional Upgrade" at a discounted price compared to the OEM version. However it states:     If you currently have a personal computer running Windows 7, Windows XP or Windows Vista then you can upgrade to Windows 8 Pro (Professional).   My question is what happens to the Windows 7 key that I use to upgrade? Will it become the Windows 8 key or will it generate a new Windows 8 key?  Basically if I upgrade using my Windows 7 key from my laptop for my desktop will I be able to continue using the laptop on Windows 7 while concurrently using Windows 8 upgrade on my Desktop? No Dialect mapping for JDBC type: -9 Slit screen and wave-particle duality In a double-slit experiment, interference patterns are shown when light passes through the slits and illuminate the screen. So the question is, if one shoots a single photon, does the screen show interference pattern? Or does the screen show only one location that the single photon particle is at? What can be considered as "Home ties" for a UK Standard Visitor visa (PLAB)? How do I run .sh scripts? Whenever I open a .sh file, it opens it in gedit instead of the terminal. I can't find any option similar to Right Click → Open With → Other Application... → Terminal.  How do I open this file in the terminal? Does my enemy get to make a saving throw for half damage for absolutely any spell I cast? So me and a group of friends recently started to play D&amp;D. I became a sorcerer. My question is: can the enemy I am attacking, no matter what spell I use, make a saving throw for half damage or does that only apply for certain spells?  For example, when I use my cantrip fire bolt, does the targeted opponent get to roll a saving throw for half damage against the spell, even though the description doesn't say anything about saving throws? "IllegalFormatConversionException: d != java.lang.String" when padding number with 0s? How do I install KDE? I want to have both KDE and Gnome shells on Ubuntu. Ubuntu only has Gnome installed by default. How do I install KDE? What is the difference between dpkg and aptitude/apt-get? When installing a software via dpkg -i packageA.deb, will the dependencies required by packageA be downloaded and installed automatically? How is this different from using apt-get or aptitude? Regular expression to extract text between square brackets Converting FLV to MP4 Using FFMPEG and Preserving the Quality Im trying to use ffmpeg to convert my flv files to mp4 to play them on iOS devices but the converted video has a much worse quality than the original one.  Here is the command i use:  ffmpeg -i input.flv -ar 22050 output.mp4   I would really appreciate if someone could provide me with the best settings for flv to mp4 conversion.