|
Sorry - never read your question properly... (Not sure about DB2)
but in any case...
Perhaps UNION ALL is what you are looking for.
(Columns in both selects must be the same)
select p, q, r
from XXX5T.MyDB5T.MyTable
UNION ALL
select p, q, r
from XXX5T.MyDB5P.MyTable
also see Linked Servers http://msdn.microsoft.com/en-us/library/ms188279.aspx[^]
modified 10-May-14 4:08am.
|
|
|
|
|
We have a relational DB in SQL Server 2008 which grinds up monthly data sets based on a set of criteria, these runs can take between 2 and 4 hours to produce and there may be 10-12 per month in 3-4 run sets. I am proposing that each run set has a cube for reporting and analysis.
The results are stored in 2 (fact) tables, each table has a view which pulls in the dimension fields, date, branch, product etc.
Each Run can result in +7m rows
Q1 Should I replicate the data into a reporting database before building the cube or build direct from the relational DB?
Q2 It has been recommended that I use the views, do I also need to pull in the dimension tables or can I use the fields in the view? eg Product dimension is serviced by a distinct of the Product column (answer - use the dimension table for cases where there is no record for a dimension element this period ).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am currently working on dash board application, I have a table say ‘User_data_master’
User_data_master(‘id’, ‘uid’, ‘data’, ‘instid’,’deptid’)
Id-primary key
uid- user id referred to user bio data
data- data posted
deptid- department id
instid- institute id
Above table will store data for different employee from different department of an institution
In select query I need to get my rows belongs to me (I have saved), Then people from my department,
Then rest of rows which belongs to my Institute.
Any help is appreciated mostly
|
|
|
|
|
|
Hello Everyone
In my application there is a login and logout functionality.if i forget to logout and logout next day. i am unable to get the accurate difference between login and logout at backend..please can anyone help me
Thank you
|
|
|
|
|
Check the DAY component of the logout datetime value!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a database(Eg. SALES) in SQL Server 2014 which needs to be recreated in SQL Server 2012 version. Since I can not use the SQL 2014 back up file in SQL 2012 environment, I have proceed with the Generate Script option and trying to run the script in SQL Server 2012 environment. However it is giving an error as Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DELAYED_DURABILITY'. which is pointing to the ALTER DATABASE [SALES] SET DELAYED_DURABILITY = DISABLED line in the script and not able to proceed further. Please help me to get this sorted out.
Thanks,
KV
|
|
|
|
|
As mentioned in the Lounge, remove that setting as it is new to 2014.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a database(Eg. SALES) in SQL Server 2014 which needs to be recreated in SQL Server 2012 version. Since I can not use the SQL 2014 back up file in SQL 2012 environment, I have proceed with the Generate Script option and trying to run the script in SQL Server 2012 environment. However it is giving an error as Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DELAYED_DURABILITY'. which is pointing to the ALTER DATABASE [SALES] SET DELAYED_DURABILITY = DISABLED line in the script and not able to proceed further. Please help me to get this sorted out.
Thanks,
Kala
modified 5-May-14 14:45pm.
|
|
|
|
|
You are in the wrong forum!!!
Welcome to the Lounge
Technical discussions are welcome, but if you need specific help please use the programming forums.
DELAYED_DURABILITY is a 2014 only - new - feature, so 2012 do not know it...Change database compatibility to 2012 (110) and try again...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Correct and Correct. +5
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Didn't notice the forum. Thank you.
KV
|
|
|
|
|
|
Lloyd Atkinson wrote: I don't know what the equivalent is in 2012. It is empty string.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
As far as I know, there is no such property DELAYED_DURABILITY in SQL 2012. Hence removed that line and ran the query, it works fine. Not sure if this is the right approach, but just tried it out.
Thanks,
KV
|
|
|
|
|
There is not such property. Removing it is just right...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Thank you Kornfeld Eliyahu Peter.
KV
|
|
|
|
|
hi,
I want to have fields in MySQL such as is_administrator, is_active, is_blocked which will be true or false, yes or no, negative or positive, or whatever name you'll use for it..
I would like to ask what's the best field type to use for such requirment?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Depends on your version.
But I'd suggest bool, bit or tinyint, depending on availability in your version.
|
|
|
|
|
Jassim Rahma wrote: I would like to ask what's the best field type to use for such requirment? What's the reason you're asking?
In MySQL[^], TINYINT(1) = BOOLEAN = BIT
A value of zero is considered false. Nonzero values are considered true.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi All,
I want to use Non in on two columns like for example I am importing Prod Cost from some history table of xml imports (example Orders table). For that what am I doing is, taking the values from Orders table in to Temporary table which have to be imported. Then I am planning to import the values from this Temp table into our ProdCost table, which do not exist for in ProdCost table for the year as well.
Like I want to use Select * from #Temp Where (year, ProdId) not in (Select Year, ProdId from ProdCost). Is there any way to do this in SQL Server?
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Try this where clause.
Where not exists (Select * from ProdCost where Year = #Temp.Year and ProdID = #Temp.ProdID)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi
i have written 3 different select query in mysql based on yesterday,today, tommorow dates to get the birthday details as follows
select concat(name,', ',title) as 'Yesterday 30-04-2014' from personal_details where DOB=curdate() - interval 1 day
select concat(name,', ',title) as 'Today 01-05-2014' from personal_details where DOB=DATE(NOW())
select concat(name,', ',title) as 'Tommorow 02-05-2014' from personal_details where DOB=curdate() + interval 1 day
how to join all 3 query results to one, i need to show as below
Yesterday Today Tomorrow
aaaa gggg nnnnn
bbbb hhhhh mmmm
dddd jjjjj
eeee
ffff
How to achieve this, i am not able to do.
If i tried with join there it wont match any condition and will not work because in each query result i will get unique values.
I tried with another query by putting as below
select a.* from (select CASE DOB WHEN (curdate() - interval 1 day) THEN concat(name,', ',title) ELSE '' END AS 'Yesterday', CASE DOB WHEN (DATE(NOW())) THEN concat(name,', ',title) ELSE '' END AS 'Today',CASE DOB WHEN (curdate() + interval 1 day) THEN concat(name,', ',title) ELSE '' END AS 'Tomorrow' from personal_details ) as a where a.Yesterday IS NOT NULL and a.Today IS NOT NULL and a.Tomorrow IS NOT NULL
It is showing the result like in all the three column some rows will be null
I dont want null values in any column. i want out as above.
How to achieve this. If anybody knows please reply me.
Thanks in advance.
|
|
|
|
|
Firstly to add your 3 queries together to act as a single result set you should look into the UNION[^] keyword.
To organise the layout so that the column headers become Yesterday, Today and Tomorrow you need to look into PIVOT[^] this example should show you how to create one.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
if i use UNION i will get one column result. I should get 3 column but without null values.
How to achieve this
|
|
|
|