Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

The problem with SQL's select *

Name: Bruce Lindsay 2011-01-31 12:05

I think one of the biggest mistakes in the SQL language was the “select *” notion. The “select *” constructs were developed to provide ease of use, but they really have been an implementation nightmare. “Select *” means select all the columns, but in what order?! The relational model says nothing about what the order of the columns might or should be, so you're really getting down to a physical storage issue here. More problematic, when you create a view as “select * from table where predicate”, what happens when I alter the table and add a column? What does the view mean now? Does it have more columns than before, or not? We have to figure out what to do about those views when their underlying tables are changed.
In fact, we have to make the meaning of the views be unchanged by the update, as otherwise existing applications would break. So I think that this is one example of not quite thinking it through all the way.

Name: Anonymous 2011-01-31 12:19

not quite thinking it through all the way
indeed, very dumb post

Name: Anonymous 2011-01-31 13:00

The relational model says nothing about what the order of the columns might or should be
It's the order you specified the columns when you created them, and the order returned by DESCRIBE.

More problematic, when you create a view as “select * from table where predicate”, what happens when I alter the table and add a column?
You RTFM to find out.

Name: Anonymous 2011-01-31 13:27

I find SQL to inflexible because I can't join stuff so I end up writing nested selects.

Name: Anonymous 2011-01-31 13:50

select MY ANUS

Name: Anonymous 2011-01-31 13:56

>>5
You have a syntax error in your SQL query. Here is an arbitrary line number that most likely doesn't pertain to the problem. RTFM.

Name: Anonymous 2011-01-31 19:35

SELECT * FROM my_anus WHERE hax IS NOT NULL;

Name: Anonymous 2011-02-03 5:41


Don't change these.
Name: Email:
Entire Thread Thread List