This is a discussion on travial querry - why this doesnt work (MsSQL user:) ) within the MySQL Database forums, part of the Database Forums category; helo! i work as MSSql admin, soo i believe thats trivial problem. i have querry, which doesnt work in MYSQL, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
helo!
i work as MSSql admin, soo i believe thats trivial problem. i have querry, which doesnt work in MYSQL, pleae help: --- START --- select * from ( (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '1' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '2' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '3' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '4' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '5' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '6' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '7' and `data_off` > '1172729640' group by `dzial`) union all (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '8' and `data_off` > '1172729640' group by `dzial`) ) as _x inner join ( (select `dzial`, count(*) from `ogloszenia` where `dzial` = '1' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '2' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '3' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '4' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '5' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '6' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '7' group by `dzial`) union all (select `dzial`, count(*) from `ogloszenia` where `dzial` = '8' group by `dzial`) ) as _y on _x.dzial = _y.dzial ---- END ---- BM -- Używam klienta poczty Opera Mail: http://www.opera.com/mail/ |
|
|||
|
On 1 Mar, 06:36, maria <m...@nomail.pl> wrote:
> helo! > i work as MSSql admin, soo i believe thats trivial problem. i have querry, Â* > which doesnt work in MYSQL, pleae help: > > --- START --- > select * from > ( > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '1' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '2' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '3' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '4' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '5' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '6' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '7' Â* > and `data_off` > '1172729640' group by `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '8' Â* > and `data_off` > '1172729640' group by `dzial`) > ) as _x > inner join ( > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '1' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '2' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '3' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '4' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '5' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '6' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '7' group by Â* > `dzial`) > Â* Â* Â* Â* union all > Â* Â* Â* Â* (select `dzial`, count(*) from `ogloszenia` where `dzial` = '8' group by Â* > `dzial`) > ) as _y on _x.dzial = _y.dzial > ---- END ---- > > BM > -- > Używam klienta poczty Opera Mail:http://www.opera.com/mail/ May I respectfully request that before we help, you help! You say "i have querry, which doesnt work in MYSQL,..." Do you tell us what doesn't work? No! Do you get a syntax error? Do you get the wrong results? Do you give us any clue? |
|
|||
|
On Mar 1, 9:44 am, "Captain Paralytic" <paul_laut...@yahoo.com> wrote:
> On 1 Mar, 06:36, maria <m...@nomail.pl> wrote: > > > > > helo! > > i work as MSSql admin, soo i believe thats trivial problem. i have querry, > > which doesnt work in MYSQL, pleae help: > > > --- START --- > > select * from > > ( > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '1' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '2' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '3' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '4' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '5' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '6' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '7' > > and `data_off` > '1172729640' group by `dzial`) > > union all > > (select `dzial`, count(*) as `ile` from `ogloszenia` where `dzial` = '8' > > and `data_off` > '1172729640' group by `dzial`) > > ) as _x > > inner join ( > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '1' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '2' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '3' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '4' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '5' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '6' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '7' group by > > `dzial`) > > union all > > (select `dzial`, count(*) from `ogloszenia` where `dzial` = '8' group by > > `dzial`) > > ) as _y on _x.dzial = _y.dzial > > ---- END ---- > > > BM > > -- > > Używam klienta poczty Opera Mail:http://www.opera.com/mail/ > > May I respectfully request that before we help, you help! > You say "i have querry, which doesnt work in MYSQL,..." > Do you tell us what doesn't work? No! > Do you get a syntax error? > Do you get the wrong results? > Do you give us any clue? First thought - don't all derived tables require aliases? |