tag:blogger.com,1999:blog-7883769006508081360.comments2023-10-29T02:31:18.425-07:00SQL Tips & TricksUnknownnoreply@blogger.comBlogger24125tag:blogger.com,1999:blog-7883769006508081360.post-52338583181060159762014-10-06T07:22:18.968-07:002014-10-06T07:22:18.968-07:00SQL-Query-to-Split-string-by-specific-seperator<a href="http://arbtech.co.in/search_blog.aspx?q=SQL-Query-to-Split-string-by-specific-seperator." rel="nofollow"> SQL-Query-to-Split-string-by-specific-seperator </a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-42724807371240516042013-11-13T07:03:57.944-08:002013-11-13T07:03:57.944-08:00try this...
select p.Nativeplace, p.Name, p.Dobirt...try this...<br />select p.Nativeplace, p.Name, p.Dobirth from personal p<br />having p.Dobirth=(select max(Dobirth) from personal p2 where p.Nativeplace=p2.Nativeplace group by p2.Nativeplace);Anonymoushttps://www.blogger.com/profile/17628625952049095019noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-54468413226515610592013-07-31T04:50:31.694-07:002013-07-31T04:50:31.694-07:00
it will work...it will show in negative valueas a...<br />it will work...it will show in negative valueas a age in months...<br /><br />Select BirthDate, DateDiff(month, BirthDate, getdate()) as Ageinmonths from HumanResources.Employee<br /><br />http://www.w3schools.com/sql/func_datediff.asp<br />Sai Kumar Shailunoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-50753142199943599232013-01-21T03:53:45.223-08:002013-01-21T03:53:45.223-08:00I am not a programmer but I have this SQL subject ...I am not a programmer but I have this SQL subject this session and have to prepare for it. What all topics should be covered in it?<br />And has anyone studied from this course www.wiziq.com/course/125-comprehensive-introduction-to-sql of SQL tutorial online?? or tell me any other guidance...<br />would really appreciate helpAnonymoushttps://www.blogger.com/profile/14953299862878053853noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-1526217649395961222012-08-23T10:53:13.874-07:002012-08-23T10:53:13.874-07:00Does not work.......Does not work.......Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-23137588963325613232012-06-24T21:51:57.008-07:002012-06-24T21:51:57.008-07:00Hi sathya.You will use convert function in backend...Hi sathya.You will use convert function in backend..like this<br /><br /> CONVERT(varchar,getdate(),106)s.gireeshhttps://www.blogger.com/profile/03813027259882897108noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-40504052666113360272012-04-26T23:33:02.484-07:002012-04-26T23:33:02.484-07:00Only works in dp2 mainframe not in data warehouse....Only works in dp2 mainframe not in data warehouse. Works fore just fine.milzedhttps://www.blogger.com/profile/01046310265412548629noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-29882404182088679762012-04-26T23:22:08.933-07:002012-04-26T23:22:08.933-07:00Has to be run in db2 mainframe. Not data warehouse...Has to be run in db2 mainframe. Not data warehouse, works just fine for memilzedhttps://www.blogger.com/profile/01046310265412548629noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-6706935401422930072012-04-15T14:49:36.751-07:002012-04-15T14:49:36.751-07:00it does not work in MySQLit does not work in MySQLankushnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-4335783422849840302012-01-03T22:42:50.222-08:002012-01-03T22:42:50.222-08:00Thanks. Helped me a lotThanks. Helped me a lotMuhammad Junaid Anjumhttps://www.blogger.com/profile/01066675162971861531noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-3461666572222859162011-11-08T09:16:59.366-08:002011-11-08T09:16:59.366-08:00Datediff function worked perfectly for me.Datediff function worked perfectly for me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-71419201370850890982011-04-26T12:21:11.731-07:002011-04-26T12:21:11.731-07:00http://stackoverflow.com/questions/4446596/unable-...http://stackoverflow.com/questions/4446596/unable-to-change-identity-specification-to-yes-in-sql-server-tableAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-15624610112574413992011-04-17T02:17:34.047-07:002011-04-17T02:17:34.047-07:00how to get output like this and get store in data ...how to get output like this and get store in data table in c#<br /><br />26 May 2002 - 01 Jun 2002<br />02 Jun 2002 - 08 Jun 2002<br />09 Jun 2002 - 15 Jun 2002<br />16 Jun 2002 - 22 Jun 2002<br />23 Jun 2002 - 29 Jun 2002<br />30 Jun 2002 - 06 Jul 2002SATHYAhttp://www.sathya1508.blogspot.comnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-42548966174524036982011-03-14T04:17:29.722-07:002011-03-14T04:17:29.722-07:00You may check out http://xmltocsv.codeplex.com/, I...You may check out http://xmltocsv.codeplex.com/, I believe this has a conversion that uses Linq to produce CSV from an XML file.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-59072737923675037602010-03-30T07:08:27.857-07:002010-03-30T07:08:27.857-07:00public int Compare(object x, object y)
{
...public int Compare(object x, object y)<br /> {<br /> FileInfo File1 = default(FileInfo);<br /> FileInfo File2 = default(FileInfo);<br /> File1 = (FileInfo)x;<br /> File2 = (FileInfo)y;<br /> return (DateTime.Compare(File1.LastWriteTime, File2.LastWriteTime))*(-1);<br /> }<br /><br />after you get all the files in the directory, use array sort. below is the code:<br /><br /> DirectoryInfo dirinfo = default(DirectoryInfo);<br /> FileInfo[] allFiles = null;<br /> dirinfo = new DirectoryInfo(strArtworkDirectory);<br /> allFiles = dirinfo.GetFiles();<br /><br /> Array.Sort(allFiles, new clsCompareFileInfo()); // this sort file by modified date desc<br /> dirinfo = null;<br /> <br /> //int count = 0; //test for the break --it works<br /> foreach (FileInfo fi in allFiles)<br /> {<br /><br /> if (fi.LastWriteTime > DateTime.Today.AddHours(-2))<br /> {<br /> //Console.WriteLine(fl.FullName.ToString());<br /> ///do sth.<br /><br /> }<br /> else<br /> break;<br /> ////count = count + 1;<br /> }<br /><br /> allFiles = null;<br /> dirinfo = null;Amy Liunoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-78602771828634091322010-02-12T07:08:08.249-08:002010-02-12T07:08:08.249-08:00nice post. thanks.nice post. thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-90767718723251708592009-12-24T12:07:41.605-08:002009-12-24T12:07:41.605-08:00Just what I needed! Thanks!Just what I needed! Thanks!Carl Connetthttp://www.extramiledata.comnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-15766621210980505712009-07-20T14:40:48.702-07:002009-07-20T14:40:48.702-07:00Is there a way to do this in reverse? using LINQ t...Is there a way to do this in reverse? using LINQ to convert an XML file to a comma delimited text file?Marinernoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-20326700436269561422009-02-17T00:55:00.000-08:002009-02-17T00:55:00.000-08:00Alternative Sample :With or without column header ...Alternative Sample :<BR/>With or without column header ...<BR/><BR/>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Orginal.xls;Extended Properties=""Excel 8.0;iif(hdr,yes,no)"""Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-54815601283901357732009-02-17T00:54:00.000-08:002009-02-17T00:54:00.000-08:00Alternative Sample :With or without column header ...Alternative Sample :<BR/>With or without column header ...<BR/><BR/>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\MyExcelFile.xls;Extended Properties=""Excel 8.0;iif(hdr,yes,no)"""Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-62820002761238137512009-02-11T13:24:00.000-08:002009-02-11T13:24:00.000-08:00Thanks Shasur, I've been trying to work out that G...Thanks Shasur, I've been trying to work out that GetDate thing for an hour!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-24045486977965236722008-09-03T09:35:00.000-07:002008-09-03T09:35:00.000-07:00i tired with my table agents select top 1 birth_da...i tired with my table agents <BR/><BR/>select top 1 birth_date from agents<BR/>order by birth_date asc<BR/> this does not work this gives error<BR/>select top 1 birth_date from agents<BR/> *<BR/><BR/>ERROR at line 1: <BR/>ORA-00923: FROM keyword not found where expected <BR/><BR/> <BR/><BR/> <BR/>i am trying to extract young member and the name of the member.<BR/> tired<BR/><BR/><BR/>select a.agent_id,a.first_name,a.birth_date,l.description<BR/><BR/> from agents a, locations l<BR/><BR/>where<BR/>a.location_id=l.location_id<BR/>and<BR/> rownum <=1<BR/><BR/>order by a.birth_date desc<BR/><BR/>this one does not give the youngest... the birthdate is somewhere in mid like 32 and the youngest is in year 1990<BR/>please tell me the solutionAratihttps://www.blogger.com/profile/09057999298516309876noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-72383538232666208682008-04-28T08:22:00.000-07:002008-04-28T08:22:00.000-07:00That only works for users that have had their birt...That only works for users that have had their birthday already this year. If the users birthday is after the current date, the age is off by 1 year.Unknownhttps://www.blogger.com/profile/13684352295910250057noreply@blogger.comtag:blogger.com,1999:blog-7883769006508081360.post-5162563417511808792007-12-11T05:27:00.000-08:002007-12-11T05:27:00.000-08:00I am using Sybase 12.5.4. Are xp_write_file and xp...I am using Sybase 12.5.4. Are xp_write_file and xp_read_file available on 12.5.4.<BR/><BR/>I tried to use these in stored procedure, it gave me following error,<BR/><BR/>'Function xp_write_file not found,....'<BR/><BR/>I tried running query <BR/>sp_help xp_write_file in subsystemprocs. It shows 'Object does not exist in this database'.<BR/><BR/>Can you help me? Thanks!Unknownhttps://www.blogger.com/profile/13184512495170153178noreply@blogger.com