Click here to Skip to main content
15,305,480 members
Home / Discussions / Database
   

Database

 
GeneralRe: Migration error from SQL 2014 to SQL 2012 Pin
Kornfeld Eliyahu Peter5-May-14 8:24
professionalKornfeld Eliyahu Peter5-May-14 8:24 
GeneralRe: Migration error from SQL 2014 to SQL 2012 Pin
Kala Vairakkannu5-May-14 8:37
MemberKala Vairakkannu5-May-14 8:37 
QuestionMySQL: best for true or false, Yes or No, negative or positive Pin
Jassim Rahma3-May-14 4:44
MemberJassim Rahma3-May-14 4:44 
AnswerRe: MySQL: best for true or false, Yes or No, negative or positive Pin
Jörgen Andersson3-May-14 6:54
professionalJörgen Andersson3-May-14 6:54 
AnswerRe: MySQL: best for true or false, Yes or No, negative or positive Pin
Eddy Vluggen3-May-14 7:49
professionalEddy Vluggen3-May-14 7:49 
QuestionNot in for two columns with Inner join Pin
indian1432-May-14 9:18
Memberindian1432-May-14 9:18 
AnswerRe: Not in for two columns with Inner join Pin
Mycroft Holmes2-May-14 13:04
professionalMycroft Holmes2-May-14 13:04 
Questionhow to join all three query results to one in mysql Pin
sr15930-Apr-14 23:01
Membersr15930-Apr-14 23:01 
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.
AnswerRe: how to join all three query results to one in mysql Pin
Simon_Whale30-Apr-14 23:12
professionalSimon_Whale30-Apr-14 23:12 
GeneralRe: how to join all three query results to one in mysql Pin
sr1591-May-14 5:34
Membersr1591-May-14 5:34 
Questionhow to fetch a table column of same name of more than 4 different database in sql server 2008r2??? Pin
Member 1078495429-Apr-14 20:24
MemberMember 1078495429-Apr-14 20:24 
AnswerRe: how to fetch a table column of same name of more than 4 different database in sql server 2008r2??? Pin
Kornfeld Eliyahu Peter29-Apr-14 21:22
professionalKornfeld Eliyahu Peter29-Apr-14 21:22 
QuestionLoading large amount of data with unacceptable time Pin
Amr Muhammed27-Apr-14 10:30
MemberAmr Muhammed27-Apr-14 10:30 
AnswerRe: Loading large amount of data with unacceptable time Pin
David O'Neil27-Apr-14 11:17
professionalDavid O'Neil27-Apr-14 11:17 
GeneralRe: Loading large amount of data with unacceptable time Pin
Amr Muhammed27-Apr-14 11:32
MemberAmr Muhammed27-Apr-14 11:32 
GeneralRe: Loading large amount of data with unacceptable time Pin
David O'Neil27-Apr-14 11:38
professionalDavid O'Neil27-Apr-14 11:38 
AnswerRe: Loading large amount of data with unacceptable time Pin
Mycroft Holmes27-Apr-14 12:54
professionalMycroft Holmes27-Apr-14 12:54 
GeneralRe: Loading large amount of data with unacceptable time Pin
Amr Muhammed27-Apr-14 19:28
MemberAmr Muhammed27-Apr-14 19:28 
GeneralRe: Loading large amount of data with unacceptable time Pin
Mycroft Holmes27-Apr-14 21:54
professionalMycroft Holmes27-Apr-14 21:54 
GeneralRe: Loading large amount of data with unacceptable time Pin
Amr Muhammed29-Apr-14 13:11
MemberAmr Muhammed29-Apr-14 13:11 
AnswerRe: Loading large amount of data with unacceptable time Pin
V.28-Apr-14 0:01
professionalV.28-Apr-14 0:01 
GeneralRe: Loading large amount of data with unacceptable time Pin
Amr Muhammed29-Apr-14 13:06
MemberAmr Muhammed29-Apr-14 13:06 
GeneralRe: Loading large amount of data with unacceptable time Pin
V.30-Apr-14 23:45
professionalV.30-Apr-14 23:45 
AnswerRe: Loading large amount of data with unacceptable time Pin
jschell28-Apr-14 8:16
Memberjschell28-Apr-14 8:16 
GeneralRe: Loading large amount of data with unacceptable time Pin
Amr Muhammed29-Apr-14 13:00
MemberAmr Muhammed29-Apr-14 13:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.