Sunday, November 24, 2013

How can I join the count in MySQL?

If I have two tables one is:

CAR

| ID |  MAKER |---------------|  1 |  Honda ||  2 | Toyota ||  3 |   Ford ||  4 |  Honda ||  5 |   Ford ||  6 |  Honda |

where id is the car id number & maker is the maker of the car

and the other is

Purchase

| CUSTID | CARID |------------------|      1 |     1 ||      1 |     4 ||      1 |     6 ||      2 |     1 ||      2 |     2 ||      2 |     4 ||      2 |     6 ||      3 |     2 ||      4 |     5 ||      4 |     2 |

where custid is the id of the customer & carid is the id to a specific car

Is there a way to join the two together & then figure out which customers have bought ALL the Hondas?

Try this query:

select P.CustIDfrom purchase Pinner join CAR C on P.CarID=C.CarIDWHERE C.Maker like '%Honda%'group by CustIDhaving count(P.CarID)=    (select count(*) from CAR C where C.Maker like '%Honda%')

SQL FIDDLE

Saturday, November 16, 2013

Remove Conduit Search from your Mac

The Conduit search plugin was automatically installed after I clicked agree button whatever DivX upgrade says by accident.
Both Firefox & Chrome are affected. By removing this plugin, first of all is I completely remove DivX :D.

Saturday, November 2, 2013

Sublime 3 Licensed (Sublime 3 Public Beta)

Sublime 3 Licensed (Sublime 3 Public Beta)

28
JUN
Go to this link & Download your OS Specific Build:

http://www.sublimetext.com/3

Mac OS X

Open Terminal & Type the following:

1. cd /Applications/Sublime\ Text.app/Contents/MacOS/
2. Now Type “vim Sublime\ Text″
3. Now Change to hex mode in vim by doing this => “:$!xxd”
4. Now we will do find & replace ->> “:%s/5BE509C33B020111/5BE509C32B020111/g”

Now open the sublime & enter the below licence key , it should work like a charm.

WINDOWS

For x64: After install, open sublime-text.exe with hex editor. Find & replace “33 42″ with “32 42″. Save & using this license key to register:

—–BEGIN LICENSE—–
Patrick Carey
Unlimited User License
EA7E-18848
4982D83B6313800EBD801600D7E3CC13
F2CD59825E2B4C4A18490C5815DF68D6
A5EFCC8698CFE589E105EA829C5273C0
C5744F0857FAD2169C88620898C3845A
1F4521CFC160EEC7A9B382DE605C2E6D
DE84CD0160666D30AA8A0C5492D90BB2
75DEFB9FD0275389F74A59BB0CA2B4EF
EA91E646C7F2A688276BCF18E971E372
—–END LICENSE—–
You should copy from Begin License till End License.

UBUNTU:

Follow these to register sublime text 3 in ubuntu
1.Install ghex editor.(in terminal,enter “sudo apt-get install ghex”)..without the quotes.
2.In terminal enter “cd /usr/lib/sublime-text″
3.In terminal enter “sudo ghex sublime_text” & enter your password
4.In open ghex window,navigate to Edit>Replace.
5.In the find string section enter 33 42
6.In the replace with section enter 32 42
7.save & exit.