7 messages in com.mysql.lists.mysqlRe: MySql doubt.| From | Sent On | Attachments |
|---|---|---|
| Renish | 26 Nov 2006 19:15 | |
| Renish | 26 Nov 2006 20:31 | |
| ViSolve DB Team | 26 Nov 2006 20:47 | |
| Renish | 26 Nov 2006 23:18 | |
| ViSolve DB Team | 27 Nov 2006 00:57 | |
| Renish | 27 Nov 2006 01:37 | |
| Rolando Edwards | 27 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 | +-------+
Thanks, ViSolve DB Team.
----- Original Message ----- From: "Renish" <kosh...@gmail.com> To: <mys...@lists.mysql.com> Sent: Monday, November 27, 2006 8:45 AM Subject: MySql doubt.
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.
Cheers, Renish koshy
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=mysq...@visolve.com




