Terminé

An SQL statement for Mysql database required

Two mysql tables: Part, Part Association

Part attributes: id, name, type

Part Association attributes: child_part_id, parent_part_id

(i.e. Part has two one-to-many relationships with Part Association)

Sample values:-

Part: [id, type] 1,A; 2,A; 3,A; 4,A; 5,A; 6,B; 7,B; 8,B; 9,C; 10,C; 11,D.

Part Association: [child_part_id, parent_part_id] 1,6; 2,9; 3,6; 3,9; 4,7; 5,11; 7,9; 10,1; 10,5.

I want sql to return all parts which are of a specific type ($firsttype) but which are not related to another part which is of another specified type ($secondtype).

Example (1), for: $firsttype='A', $secondtype='B'

Result should be Part id's: 2, 5.

That is parts 2 and 5 are of type 'A' but are not related to any part of type B.

Example (2), for: $firsttype='A', $secondtype='C'

Result should be Part id's: 1, 4, 5.

That is parts 1, 4 and 5 are of type 'A' but are not related to any part of type C.

Example (3), for: $firsttype='B', $secondtype='C'

Result should be Part id's: 6, 8.

That is parts 6 and 8 are of type 'B' but are not related to any part of type C.

Compétences : MySQL, SQL

En voir plus : sql export mysql database, sql statement delete database, sql query remote database mysql, import sql file mysql database, php script mysql database import sql file, php copy sql file mysql database, icecat mysql database sql, convert mysql database compact sql, i want to write a letter to aunt who is working at johanesburg and tell her that her sun has broken an angle when playing soccee, sql query for a mysql database, export mysql database to sql file, how to create an html form that stores data in a mysql database using php part 1 of 4, how to create an html form that stores data in a mysql database using php, how to create an html form that stores data in a mysql database, restore mysql database from sql file, how to import .sql file in mysql database using php, how to display an image in php from mysql database example, how to restore mysql database from sql dump file in linux, how to display an image in php from mysql database, how to share mysql database between two computers

Concernant l'employeur :
( 1 commentaire ) Lincoln, United Kingdom

Nº du projet : #30567041

Décerné à:

eha5583ba20b7ea9

Hi there, I am PHP web developer having worked with SQL databases. I can perform this task. Let me know if you are interested. Thanks.

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% GBP en 1 jour
(5 Commentaires)
2.2

3 freelances font une offre moyenne de 15 £ pour ce travail

savvysoftsol

Hello, I am an expert in MySql with an experience of 7+ years in it. I can solve your database error after discussing with you start work on it. Looking forward to discuss with you in detail and start work on it. Th Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% GBP en 1 jour
(3 Commentaires)
2.3
ethereal3322

Hello. Thanks for your posting. My focus point is to give best results which is above the clients expectation. I am a professional engineer with 8+ years experiences SQL I am a skilled programmer who able to learn and Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% GBP en 1 jour
(1 Évaluation)
0.8