7 messages in com.mysql.lists.mysqlRe: MySql doubt.
FromSent OnAttachments
Renish26 Nov 2006 19:15 
Renish26 Nov 2006 20:31 
ViSolve DB Team26 Nov 2006 20:47 
Renish26 Nov 2006 23:18 
ViSolve DB Team27 Nov 2006 00:57 
Renish27 Nov 2006 01:37 
Rolando Edwards27 Nov 2006 06:11 
Subject:Re: MySql doubt.
From:ViSolve DB Team (mysq@visolve.com)
Date:11/26/2006 08:47:40 PM
List:com.mysql.lists.mysql

Hi Renish,

Here's the answer for your query.

mysql> select * from a; +--------+ | item | +--------+ | book | | pencil | | table | | chair | +--------+

mysql> select * from b; +--------+-----------+ | item | price | +--------+-----------+ | pencil | 11 dollar | | book | 12 dollar | +--------+-----------+

You can use this query to get the items which doesnt have price.

mysql> select item from a where item not in ( select item from b); +-------+ | item | +-------+ | table | | chair | +-------+

Hi Guys,

I have an easy doubt..

Table A consist of field Item and Table B consist of field Price. Table A consists of Items which has price aswell the items which doesnt have price. But In Table B,I have kept only the item which has price . Now, I want to subtract the total items in Table A to the total items in Table B. so I get the items which doesnt have price. I used union its not working.. can any of u guys write the code for it,,,

For example

Table A Item Book Pencil Table Table B- which consists of Item with price

Price -Book-11 dollar Pencil-2 dollar

Please reply me asap. I hope it should be v. easy enough to tackle.