Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select question
Message
 
 
To
27/07/2009 17:04:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01414630
Message ID:
01414878
Views:
25
>>>According to the VFP Help HAVING without group by has the same effect as WHERE. Therefore, for me the latter of your suggestions is better. Or dealing with the query cursor in VFP after it is selected in a separate SQL Select.
>>
>>Yes it has the same effect but it executes later and can see field aliases.
>
>You are correct. I knew there was no use reading VFP help <g>. Thank you.

It doesn't work this way in SQL Server.

I just tried
select ID, Searched as Search from TestTable having Search like 'Daughter%'
and it produced an error.

Msg 207, Level 16, State 1, Line 1
Invalid column name 'Search'.

This didn't work either
select max(ID) as MaxID, Searched as Search from TestTable group by Searched having Search like 'Daughter%'
Only using the original field name like
select max(ID) as MaxID, Searched as Search from TestTable group by Searched having Searched like 'Daughter%'
worked.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform