473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to write this query

Hi,

I have below table structures
Id'd Status Id's
Table A: table_a_id number(10) pk Data: 1 Approved
status nvarchar2(10)

Table B table_b_id number(10) pk Data: 1 Paid
status nvarchar2(10) 2 Unpaid

Table B: table_c_id number(10) pk Data: 1 1 1
table_a_id number(10) fk A 2 1 2
table_b_id number(10) fk B

Now my question is how can i write query to get coun(*) = 0 from table A if there is record exist in table B with status = 'Unpaid'
I hope the info. provided above is sufficient.
Regds,
Bhushan
Sep 27 '07 #1
1 1249
hi

I have below table structures

Table A:
table_a_id number(10) pk
status nvarchar2(10)

Data for Table A:
1 Approved

Table B
table_b_id number(10) pk
status nvarchar2(10)

Data for Table B:
1 Paid
2 Unpaid

Table C:
table_c_id number(10) pk
table_a_id number(10) fk A
table_b_id number(10) fk B

Data For table C:
1 1 1
2 1 2

Now my question is how can i write query to get coun(*) = 0 from table A if there is record exist in table B with status = 'Unpaid'
I hope the info. provided above is sufficient.
Regds,
Bhushan[/quote]
Sep 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers...
0
by: Tanamon | last post by:
Hello All, I am a MySQL newbie trying to write a query that selects file_name records possessing the highest numbered version for that unique file_name. I show sample data and two trial queries...
7
by: Scott | last post by:
I need help to modify the code below to pass url variables from a framset. The click to run this will be in the mainFrame. This script works well in a non-frame page. Grabs the current url...
2
by: laredotornado | last post by:
Hello, Using PHP 4 and MySQL 4, how would I write a function such that it takes a valid MySQL query, and a column on which to order the query, and return a new query ordered by that column? ...
3
by: Jason Huang | last post by:
Hi, In my C# windows form project, I would like to have a function which will write the SQL query result into an XML file. Would someone tell me how to do this? Thanks for help. Jason
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
1
by: lorirobn | last post by:
Hi, I have a query that I have been using as a record source for a form with no problems. I just created a new "addnew" form, and added 20 records to the table with this form. The problem I...
2
by: Himmel | last post by:
Hello! The reference database I currently use runs queries that pull data from hundreds of tables in order to create user-friendly form view. The problem is that these queries can take upwards of...
1
by: manikandaprabhu | last post by:
hi all, i am manikandaprabhu. can you help me out in writing the query which should meet the standards and also must have less exection time.how to write a perfect query.And the procedures...
5
by: Jon Skeet [C# MVP] | last post by:
On Sep 9, 9:41 am, raylopez99 <raylope...@yahoo.comwrote: It's tricky in .NET for two reasons: 1) LINQ doesn't have any concept of "remove" 2) List<T>.RemoveAll doesn't pass in the index...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.