Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoid the _a and _b when selecting * from both tables?
Message
From
13/10/2004 09:08:11
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
13/10/2004 08:50:03
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00950839
Message ID:
00951017
Views:
9
Unfortunately our shop frowns on notation in field names. And everywhere, now that I think about it. In addition, we have an intenet portion that the coders for that have been dragging their feet on in regards to upgrading the version so we could use names longer than 10. There is a conversion process from the data to the internet and we are stuck for now with the lowest common denominator.

There are times when using * is good when you're not sure of everything you will need down the line. Not every portion of an app has the advantage of time to be well thought out planned in advance. I have used * before then gone back and modified it to be a field list after I knew what fields were relevant to the functionality. That way I could continue to debug/test and not revise the list each time. I guess another way would be to always start out listing every field from every table and then just trim that down later, but isn't * so much easier to type? <s>


>There is one way to minimize this "problem". Use a naming convention that makes field names more unique. For example, if you have products and companies, don't give both of them a field called name. Make one prdname and the other cmpname. Prd_PK and Cmp_PK would prevent PK_A and PK_B. For foreign keys, like a product referenced in a line items table, use linprdfk. The only time you'd have to worry is when you are joining a table with itself. I hardly ever do select * anyways.
>
>>Any way without having to specify the actual fields to get all the columns from table A, named as they exist, and then all the remaining fields from table B. I do not want to specify the fields that are common to both tables. I want matching records and only 1 occurance of all columns.
>>
>>For example:
>>
>>
>>SELECT TableA.*, TableB.* WHERE A.Fieldx = B.Fieldx
>>
>>
>>With the result being:
>>
>>
>>Field1, Field2, Field3...
>>
>>
>>Not:
>>
>>
>>Field1_a, Field1_b, Field2, Field3...
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform