Showing posts with label asking. Show all posts
Showing posts with label asking. Show all posts

Wednesday, March 21, 2012

Maybe I'm asking for too much.

I’m using oracle but I’m sure this problem will have similar solution to SQL. I have a list of string in a table (aa, bb, cc, dd). I also have a list of numbers that are not in the database. What I’m looking for is an output like this.

Aa, 11

Aa, 22

Bb, 11

Bb, 22

Cc, 11

Cc, 22

Dd, 11

Dd, 22

Is this possible, without having to insert the numbers in a database table and with a simple query? (this could be done with temporary table)

? Sure... SELECT YourTable.YourStringColumn, N.Number FROM YourTable CROSS JOIN ( SELECT 11 UNION ALL SELECT 22 ) N (Number) -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <ThE_lOtUs@.discussions..microsoft.com> wrote in message news:484c9f08-620e-46e9-bc35-83620c31d17d@.discussions.microsoft.com... I’m using oracle but I’m sure this problem will have similar solution to SQL. I have a list of string in a table (aa, bb, cc, dd). I also have a list of numbers that are not in the database. What I’m looking for is an output like this. Aa, 11 Aa, 22 Bb, 11 Bb, 22 Cc, 11 Cc, 22 Dd, 11 Dd, 22 Is this possible, without having to insert the numbers in a database table and with a simple query? (this could be done with temporary table)

Friday, March 9, 2012

maximum joins

hello,
is there a restriction how many joins a query can have?
I am asking, because we have a query generator and probably we
will reach such a limit.
we have a star design.
one table in the center and probably thousand around this center table.
now we need to join theses tables generically.
thank you.
michael
256
http://www.aspfaq.com/2345
http://www.aspfaq.com/
(Reverse address to reply.)
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:D3F4C674-D21D-4CE2-B183-8A48B3D5D4F4@.microsoft.com...
> hello,
> is there a restriction how many joins a query can have?
> I am asking, because we have a query generator and probably we
> will reach such a limit.
> we have a star design.
> one table in the center and probably thousand around this center table.
> now we need to join theses tables generically.
> thank you.
> michael
>
|||According to Books Online the limit is 256 tables per query (can't say I've
ever put this to the test).
By "star design" do you mean a dimensional star schema? If so, you may want
to rethink what you are trying to do. There doesn't seem much point creating
a star schema if you want to do relational queries which then become so
complex. 1000 dimension tables seems pretty exceptional too!
David Portas
SQL Server MVP

maximum joins

hello,
is there a restriction how many joins a query can have?
I am asking, because we have a query generator and probably we
will reach such a limit.
we have a star design.
one table in the center and probably thousand around this center table.
now we need to join theses tables generically.
thank you.
michael256
http://www.aspfaq.com/2345
http://www.aspfaq.com/
(Reverse address to reply.)
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:D3F4C674-D21D-4CE2-B183-8A48B3D5D4F4@.microsoft.com...
> hello,
> is there a restriction how many joins a query can have?
> I am asking, because we have a query generator and probably we
> will reach such a limit.
> we have a star design.
> one table in the center and probably thousand around this center table.
> now we need to join theses tables generically.
> thank you.
> michael
>|||According to Books Online the limit is 256 tables per query (can't say I've
ever put this to the test).
By "star design" do you mean a dimensional star schema? If so, you may want
to rethink what you are trying to do. There doesn't seem much point creating
a star schema if you want to do relational queries which then become so
complex. 1000 dimension tables seems pretty exceptional too!
David Portas
SQL Server MVP
--

maximum joins

hello,
is there a restriction how many joins a query can have?
I am asking, because we have a query generator and probably we
will reach such a limit.
we have a star design.
one table in the center and probably thousand around this center table.
now we need to join theses tables generically.
thank you.
michael256
http://www.aspfaq.com/2345
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:D3F4C674-D21D-4CE2-B183-8A48B3D5D4F4@.microsoft.com...
> hello,
> is there a restriction how many joins a query can have?
> I am asking, because we have a query generator and probably we
> will reach such a limit.
> we have a star design.
> one table in the center and probably thousand around this center table.
> now we need to join theses tables generically.
> thank you.
> michael
>|||According to Books Online the limit is 256 tables per query (can't say I've
ever put this to the test).
By "star design" do you mean a dimensional star schema? If so, you may want
to rethink what you are trying to do. There doesn't seem much point creating
a star schema if you want to do relational queries which then become so
complex. 1000 dimension tables seems pretty exceptional too!
--
David Portas
SQL Server MVP
--