Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using * in sqlselect
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Using * in sqlselect
Miscellaneous
Thread ID:
00776918
Message ID:
00776918
Views:
59
I wonder whats best, to specify every field in an sqlselect, or use a * (a "star", I dont know the english word).
Example:
I make a select and join 2 tables. Table 1 has 40 fields and table 2 has 40 fields. I need 35 fields from each table. (I send the select command to a SQL2000 server)

Is it better to fetch ALL fields with a select like this:
select * from table1,table2,...
Or like this
select table1.*,table2.*,...
Or should I specify every field one by one like this:
select table1.field1,table2.field1,table2.field2,...

If I use a ' * ' I get more fields than I want. In this example I get 5 fields from each table that I can ignore in the result. But I am willing to sacrifice that because its easier to write and shorter.

Or are there some rule that says that I always schould specify every field. The select command can be VERY long i this case.

Of course I specify the fields if I only need a few fields from the tables, but my wondering is when I want almost every fields (can be more than 100).

I hope you understand my question.
Thankyou
/Kjell
Next
Reply
Map
View

Click here to load this message in the networking platform