tag:blogger.com,1999:blog-248021172024-03-14T00:43:36.456+08:00Database BlogThis blog will show or teach you some basic SQL syntax used in various kinds of databaseUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-24802117.post-16345393187344003982009-07-22T10:38:00.002+08:002010-06-18T16:38:47.609+08:00Autopilot IncomeHow would you feel if I could show you how to earn your monthly income with only a couple hours prep work a month? <br />
<br />
Read more to see the details...<br />
<a name='more'></a><br />
<!--Begin---><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" align=left> </p><br />
<center><br />
<table style="BORDER-COLLAPSE: collapse" borderColor=#46cff1 cellSpacing=0 cellPadding=10 width=562 bgColor=#ffffff border=3><tbody>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=536><br />
<h2 class="style1 style3" style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" align=center><font face=Tahoma>Free Report Reveals How To <font color=#ff0000>Earn Autopilot Income For Life</font>... Starting From Scratch!</font></h2><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" align=left><br />
<span id=dgAffAssociatedProductList__ctl3_Label25><font face=Tahoma size=2><a target=_blank><img height=282 src="http://www.unstoppablelistbuilding.com/images/ecover4.jpg" width=230 align=right border=0></a></font></span><span class=spnMessageText id=msg1><font face=Verdana color=#000000 size=2>How would you feel if I could show you how to earn your monthly income with only a couple hours prep work a month?</p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">I do it, and now I'm going to help you do the same...</p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Right now, I'm giving away quite possibly the most valuable guidebook you'll ever own. </p></font></span><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><span class=style10><font face=Verdana size=2>Here's just a sample of what you'll discover...</font></span></p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p><br />
<table id=AutoNumber40 style="BORDER-COLLAPSE: collapse" borderColor=#111111 height=60 cellPadding=5 width=541 border=0><tbody>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" vAlign=top align=left width=16 height=31><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana color=#46cff1 size=2>>></font><font face=Verdana color=#9933ff size=2> </font></b></p></td>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=505 height=31><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana>A step-by-step plan that starts from </font></b></p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana>scratch & takes you to unimagined heights</font></b></p></td></tr>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" vAlign=top align=left width=16 height=31><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana color=#46cff1 size=2>>></font><font face=Verdana color=#9933ff size=2> </font></b></p></td>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=505 height=31><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><font face=Verdana>How to setup passive income for life</font></p></td></tr>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" vAlign=top align=left width=16 height=1><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana color=#46cff1 size=2>>></font><font face=Verdana color=#9933ff size=2> </font></b></p></td>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=505 height=1><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><b><font face=Verdana>A</font></b><font face=Verdana size=2><b> method easy enough for even the rawest rookie to understand & start implementing today.</b></font></p></td></tr>
<font face="Verdana, Arial, Helvetica" color=#ff0000 size=4>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" vAlign=top align=left width=16 height=1><span id=dgAffAssociatedProductList__ctl4_Label35><b><font face=Verdana color=#46cff1 size=2>>></font></b></span><font face=Verdana color=#46cff1 size=2> </font></td></font><font face="Verdana, Arial, Helvetica" size=4>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=505 height=1><font face=Verdana size=2>The “secret tweak” gurus have been using to generate millions of dollars right before your eyes…</font></td></tr>
</font><font face="Verdana, Arial, Helvetica" color=#ff0000 size=4>
<tr>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" vAlign=top align=left width=16 height=1><span id=dgAffAssociatedProductList__ctl4_Label26><b><font face=Verdana color=#46cff1 size=2>>></font><font face=Verdana color=#9933ff size=2> </font></b></span></td></font>
<td style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; FONT-VARIANT: normal" width=505 height=1><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><font face=Verdana size=2><b>How to print money on demand like magic whenever you want</b></font></p></td></tr>
</tbody></table><font face="Verdana, Arial, Helvetica" color=#ff0000 size=4><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p><br />
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" align=center><b><span id=dgAffAssociatedProductList__ctl2_Label28><font face=Tahoma color=#0000ff size=4><u><a href="http://www.unstoppablelistbuilding.com/cmd.php?Clk=3147967"><b><span id=dgAffAssociatedProductList__ctl2_Label28><font face=Tahoma color=#0000ff size=4><u>Grab Your Free Guide To A Lifetime Of Passive Income</u></font></span></b></a></u></font></span></b></font></p></td></tr>
</tbody></table></center><br />
<br />
<img src="http://www.unstoppablelistbuilding.com/cmd.php?Imp=3147967" width="0" height="0" border="0"><br />
<!--End--->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24802117.post-36305232944709310372009-05-19T16:01:00.002+08:002009-05-19T16:53:13.478+08:00CONCAT in MySQL<p> </p><p>Here I will show you how to do string concatenation in MySQL select statement.</p><p>Assume you have a table like below </p><table border="0" width="99%"><tbody><tr align="center"><td colspan="3"><strong> Table: employee</strong> (before concatenation)<br /></td></tr><tr><td width="33%" align="center"><strong> id</strong></td><td width="33%" align="center"><strong>firstname </strong><br /></td><td width="33%" align="center"><strong>lastname </strong><br /></td></tr><tr><td align="center"> 1</td><td align="center"> John</td><td align="center"> Doe</td></tr></tbody></table><p> </p><p>and you want your query to return like this:</p><table border="0" width="99%"><tbody><tr align="center"><td colspan="3"><strong> Table: employee</strong> (after concatenation)<br /></td></tr><tr><td width="33%" align="center"><strong> id</strong></td><td colspan="2" width="33%" align="center"><strong>fullnam</strong><strong>e </strong><br /></td></tr><tr><td align="center"> 1</td><td colspan="2" align="center"> John Doe</td></tr></tbody></table><p> </p><p>Its easy, the query is like this:</p><p><strong><font color="#008000">SELECT id, CONCAT(firstname, ' ', lastname) AS fullname FROM employee </font></strong></p><p>If you want it to be return like for example: <strong>Firstname: John, Lastname: Doe</strong></p><p>Try this: <strong><font color="#008000">SELECT id, CONCAT('Firstname: ', firstname, ', Lastname: ', lastname) AS fullname FROM employee</font></strong></p><p>See how to do this in <a href="http://reduone.com/index.php/database/45-vistadb/88-concat-in-vistadb">VistaDB</a> </p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24802117.post-1147858988022235792006-05-17T17:37:00.001+08:002010-05-26T07:56:27.419+08:00Convert string to date in mySQL 2In my <a href="http://mr-database.blogspot.com/2006/04/convert-string-to-datetime-in-mysql.html">previous blog</a>, I've show how to convert a string in database to a datetime format. That syntax is only supported in mySQL 4.0 and above. In that version, it uses this syntax: <br />
<br />
STR_TO_DATE(date,'%d/%m/%Y')<br />
<br />
So, for mySQL 4.0 and below, just change the syntax to:<br />
<br />
DATE_ADD( CONCAT(SUBSTRING_INDEX(`date`,'/',-1) , '-' , SUBSTRING_INDEX(substring_index(`date`,'/',2),'/',-1) , '-', SUBSTRING_INDEX(`date`,'/',1)), interval 0 day)<br />
<br />
Example:<br />
<br />
4.0 and above:<br />
SELECT STR_TO_DATE(date,'%d/%m/%Y') AS myNewdate FROM myTable<br />
<br />
below 4.0<br />
SELECT DATE_ADD( CONCAT(SUBSTRING_INDEX(`date`,'/',-1) , '-' , SUBSTRING_INDEX(substring_index(`date`,'/',2),'/',-1) , '-', SUBSTRING_INDEX(`date`,'/',1)), interval 0 day) AS myNewdate FROM myTableUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-24802117.post-1145348729160988152006-04-18T16:13:00.001+08:002010-05-26T07:48:12.823+08:00Convert string to date in mySQLif you have a date column in a table that has a string datatype, it is impossible to query or find the record between 2 durations of date. for example, you have a table "myTable"<br />
<br />
<h2><b>myTable</B></H2>---------------------------<br />
<b>Column</B> | <b>Type</B><br />
---------------------------<br />
date | varchar<br />
<br />
it is impossible to query like this<br />
SELECT * FROM myTable WHERE date>='@dtFrom' AND date<='@dtTo'
the correct way to get the record between the 2 dates is like this
SELECT * FROM myTable WHERE STR_TO_DATE(date,'%d/%m/%Y') <= '@dtFrom' AND STR_TO_DATE(date,'%d/%m/%Y') <= '@dtTo'
STR_TO_DATE(date,'%d/%m/%Y') the type '%d/%m/%Y' is depend on how you store the date into the table. In my case, I store it as 18/04/2006
more help can be found here - <a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html">dev.mysql.com</a>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-24802117.post-1143428172967974342006-03-27T10:54:00.000+08:002006-03-27T10:56:12.973+08:00IntroductionJust an introduction. This blog will be discussing on programming with database or database query. Stay tuned for the next update.Unknownnoreply@blogger.com0