Dear MySQL Users,
I am facing problem in MySQL querry , I need
results like
Country Total
India (2)
Lanka (1)
China (1)
Russia (0)
Afganistan (0)
I have two table one is having all country details
and other having records in that country. Table
structure will sample records are:
#Structure of main table:
CREATE TABLE location (
state varchar(100),
country varchar(50),
continent varchar(15)
);
Sample Data:
INSERT INTO location VALUES( 'MAHA', 'India', 'ASIA');
INSERT INTO location VALUES( 'GUJ', 'India', 'ASIA');
INSERT INTO location VALUES( 'Lanka', 'Lanka',
'ASIA');
INSERT INTO location VALUES( 'China', 'China',
'ASIA');
INSERT INTO location VALUES( 'Afganistan',
'Afganistan);
INSERT INTO location VALUES( 'Russia','Russia',
'ASIA');
And Other table is :
CREATE TABLE church_details (
id_no int(10) unsigned zerofill DEFAULT
'0000000000' NOT NULL auto_increment,
info_name varchar(150) NOT NULL,
address1 varchar(150) NOT NULL,
state varchar(100) NOT NULL,
country char(50) NOT NULL,
PRIMARY KEY (id_no)
);
#
# Dumping data for table 'church_details'
#
INSERT INTO church_details VALUES( '1', 'anil',
'Kandivali', 'MAHA', 'India');
INSERT INTO church_details VALUES( '2', 'kumar',
'Baroda', 'GUJ', 'India');
INSERT INTO church_details VALUES( '3', 'Surya',
'Colombo', 'Lanka', 'Lanka');
INSERT INTO church_details VALUES( '4', 'Leee',
'Xiaon', 'China', 'China');
Pls try to solve the querry.
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
----------------------------------------------
Find out more about this and other Linux India
mailing lists at http://lists.linux-india.org/