Information générale
Titre:
Group by clause changes and keeping sql dynamic
Suppose I have
SELECT * FROM MYTABLE GROUP BY FIRSTFIELD, SECONDFIELD INTO TABLE MYTABLE2
Assume that firstfield and secondfield are the only fields in the table, so this query works in 8.0.
Now assume that someone adds a field to the table and this query now crashes because I don't have all of the fields in the group by clause.
Let's assume that we were dynamically building this table everytime "something" ran. If a field was added to "mytable" then this would not work anymore and it really stops being dynamic, because now if this happens, we need to change the code.
I suppose the proper way to handle this is to only select what you need so that way when you need something more than what you have already asked for you would need to go change the code anyway?
How do you keep things dynamic with this change and if you are selecting * in the query? I tried using mytable.* but I get errors that way.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement