Bluehost.com Web Hosting $6.95

travial querry - why this doesnt work (MsSQL user:) )

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, ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2007
maria
 
Posts: n/a
Default travial querry - why this doesnt work (MsSQL user:) )

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/
Reply With Quote
  #2 (permalink)  
Old 03-01-2007
Captain Paralytic
 
Posts: n/a
Default Re: travial querry - why this doesnt work (MsSQL user:) )

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?

Reply With Quote
  #3 (permalink)  
Old 03-01-2007
strawberry
 
Posts: n/a
Default Re: travial querry - why this doesnt work (MsSQL user:) )

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?

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0