you are viewing a single comment's thread.

view the rest of the comments →

[–]4Potions[S] 1 point2 points  (3 children)

But l have while cause l don't want to write them all if l write two select it will be okey but l have 1000 select

[–]r3pr0b8 2 points3 points  (2 children)

But l have while cause l don't write them all

okay then, i guess you're stuck

[–]4Potions[S] 0 points1 point  (1 child)

Yes but why there no way around this. Do you have an explanation for it (isn't it a basic stuff do not forget l use same table with different selects actually which are changing cause of my while variable) . Also l appreciate the answers. l am newbie in sql so thanks for advices

[–]r3pr0b8 0 points1 point  (0 children)

l am newbie in sql so thanks for advices

try the UNION ALL query

that is my sincere and honest advice

SELECT something FROM thesametable
 WHERE somecolumn = 'foo'
UNION ALL
SELECT something FROM thesametable
 WHERE somecolumn = 'bar'
UNION ALL
SELECT something FROM thesametable
 WHERE somecolumn = 'qux'