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)
No comments:
Post a Comment