Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force SQL select to make an const integer column?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00338053
Message ID:
00338227
Views:
10
Hi Bela,

A cartesian join is one where every row in the first table is joined with every row in the second. In this case, there's only one row in the second table so the number of rows in the result is the same as the number of rows in the first table, but the result table has all of the fields from the second table as well.

You achieve this by telling the SQL statement to use both tables, but not supplying a join condition.

Cheers,

Andrew

>>Bela,
>>
>>I often do this by creating a one-row cursor containing the constant integer and doing a cartesian join with the required fields from the table.
>>
>>E.G.
>>
>>
create cursor const (const I)
>>insert into const values (0)
>>select last_name, const ;
>>  from (home(2) + 'data\employee'), const
>>list stru
>>
>>Cheers,
>>
>>Andrew
>>
>>>Dear All,
>>>
>>>I would like to do something like this:
>>>
>>>select ..., 0 ....
>>>
>>>
>>>I want the select statement to make the column of zero of integer type. But istead it gives me a 1 digit wide numeric column.
>>>
>>>Does anybody know the right syntax?
>>>
>>>TIA
>>>
>>>bb
>
>Dear Andrew,
>
>Although, I feel the meaning of the word: cartesian, but unfortunately I
>havent found it in my dictionary. What does it really mean?
>TIA
>
>bb


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Reply
Map
View

Click here to load this message in the networking platform