[Solved] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘0

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘0 solved You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘0

[Solved] where clause with date range give strange result

there are many ways of skinning this particular cat, this is just one method. By the way in your example you gave a date of 31st April, this does not exists. SELECT TO_Char(ordered_date,’DD-MON-YYYY’) as ordered_date, order_number, customer_name FROM order_tbl WHERE NVL(:P_ORDER_NUMBER, order_number) = order_number AND ordered_date between NVL(TO_DATE(:P_FROM_DATE,’DD-MON-YYYY’),TO_DATE(’01-MAR-1900′,’DD-MON-YYYY’)) and NVL(to_date(:P_TO_DATE,’DD-MON-YYYY’),TO_DATE(’31-DEC-2100′,’DD-MON-YYYY’)) AND NVL(:P_CUSTOMER_NAME, customer_name) = customer_name … Read more

[Solved] Comma-separation trouble

You can use SELECT Split.r.value(‘.’, ‘VARCHAR(100)’) AS Data FROM ( SELECT CAST (‘<M>’ + REPLACE(roolno, ‘,’, ‘</M><M>’) + ‘</M>’ AS XML) AS Data FROM table1 ) AS r CROSS APPLY Data.nodes (‘/M’) AS Split(r); or if you want to put where clause you can put it like this SELECT Split.r.value(‘.’, ‘VARCHAR(100)’) AS Data FROM ( … Read more

[Solved] Java GUI syntax error in SQL statment

Oh my god, thanks @Orel Eraki, of course beside the unbalanced single-quotes you will have to follow proper SQL Insert Syntax and hava a form of ‘INSERT INTO …’, try it like this (see my change dirctly after “values(” as the one of Orel Eraki (no ‘table’ “keyword” after into): Sql_insert=”insert into itemmanag(itemID,purchesPrice,sellPrice,quantity,vendor,unitM )values(‘”+txt_itemID.getText()+”‘,'”+Item_Pprice.getText()+”‘,'”+txt_itemSprice.getText()+”‘,'”+txt_qunti.getText()+”‘,'” +jcombo1+”‘,'”+jcombo2+ … Read more

[Solved] How to convert the Varchar of sum to time using sql server 2008 [closed]

Try this: DECLARE @SUM VARCHAR(50)=’33.90′; SELECT CAST(CAST(LEFT(@SUM,CHARINDEX(‘.’,@SUM,0)-1) AS INT)+ CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)/60 AS VARCHAR(10))+’.’+ CAST(CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)%60 AS VARCHAR(10)) result: 34.30 1 solved How to convert the Varchar of sum to time using sql server 2008 [closed]

[Solved] Select distinct record from table and perform Sum of column (Pallats, Gross) of a duplicate row. And show that duplicate rows once [closed]

You seem to want aggregation: select disport, actualagent, . . . , country, sum(pallats), sum(gross) from t group by disport, actualagent, . . ., country; You need to list all the columns where the . . . is. 1 solved Select distinct record from table and perform Sum of column (Pallats, Gross) of a duplicate … Read more

[Solved] how to save sql query result to csv in pandas

You can try following code: import pandas as pd df1 = pd.read_csv(“Insert file path”) df2 = pd.read_csv(“Insert file path”) df1[‘Date’] = pd.to_datetime(df1[‘Date’] ,errors=”coerce”,format=”%Y-%m-%d”) df2[‘Date’] = pd.to_datetime(df2[‘Date’] ,errors=”coerce”,format=”%Y-%m-%d”) df = df1.merge(df2,how=’inner’, on =’Date’) df.to_csv(‘data.csv’,index=False) This should solve your problem. 4 solved how to save sql query result to csv in pandas

[Solved] Left join combining GETDATE()

You can use apply: select a.*, b.* from a cross apply (select top (1) b.* from b where b.code = a.code and b.time < getdate() order by b.time desc ) b; This assumes that time is really a datetime. If you just want to compare times, then use convert(time, getdate()). 2 solved Left join combining … Read more