Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub Query anyone?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00253101
Message ID:
00253154
Views:
19
Erik, in this case it works quite well.

I am using the where clause to fire the not in subquery. So I am postponing the "validation" normaly placed in the "where" till after the sets are put together. So a having is correct, in this case.

The more I play with this stuff the more confused I become. Do you ever read those SQL for Smarties books? I think that there are 2 out now. I use to have access to them at a former job. Great for tough SQL! Joe Celko who has a column in DBMS mag.


Any ideas on getting what I wanted?




>>SELECT lv_icitem_desc.item , lv_icitem_desc.itmclss ;
>> FROM lv_icitem_desc WHERE item NOT IN ;
>> (SELECT DISTINCT item_no as item FROM lv_inv_count) ;
>> order by 2,1 having val(itmclss) > 5
>
>
>You can only use the HAVING clause in conjunction with a GROUP BY. It is like a WHERE for a group. Is there a reason you're not just using WHERE VAL(itmclss) > 5?
Previous
Reply
Map
View

Click here to load this message in the networking platform