If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Query ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-04, 14:57
k_vasu k_vasu is offline
Registered User
 
Join Date: Aug 2002
Posts: 35
Query ?

SELECT CUSTOMER_id,
COUNT(VIN) as X
FROM VEHICLE
WHERE X > 100
group by CUSTOMER_id

Why X is giving problem
__________________
vasu
Reply With Quote
  #2 (permalink)  
Old 01-23-04, 14:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: Query ?

Quote:
Originally posted by k_vasu
SELECT CUSTOMER_id,
COUNT(VIN) as X
FROM VEHICLE
WHERE X > 100
group by CUSTOMER_id

Why X is giving problem
Try this:

SELECT CUSTOMER_id,
COUNT(VIN) as X
FROM VEHICLE
group by CUSTOMER_id
having count(vin) > 100
Reply With Quote
  #3 (permalink)  
Old 01-23-04, 15:05
k_vasu k_vasu is offline
Registered User
 
Join Date: Aug 2002
Posts: 35
Thank you very much.
__________________
vasu
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On