I have a table named data_values stored in SYBASE in the following format: The value field has the following XML format: I want to select from the value field values like value1, value2, etc. but I can’t find a correct query to do this. I have tried: also value is a reserved keyword I think and I need to escape
Tag: sybase
SQL – Remove Blanks/nulls rows and combine rows
I want to combine multiple rows into as few rows as possible by removing nulls Current: Table1 want: Table2: Answer For your sample data and results you can use:
Difference between JOIN and Inner JOIN in Sybase
I have a query like below. I don’t understand the difference between join vs inner join used on the below code. Aren’t they the same? This is written for Sybase. Please help me know the difference. Answer According to the standard INNER JOIN=JOIN. I think, Sybase does not break this rule
need to form SQL join/subQuery on multiple tables
There are 3 tables – tables — columns ABC – abc_id, abc_name, active_flag XYZ – xyz_id, xyz_name, active_flag ABC_XYZ – abc_xyz_id, abc_id, xyz_id, active_flag id column in each table is PK I need to form a query which will return output like – for each abc_name there will be multiple xyz_names like below – abc_name1 – abc_name2 – I am
Update statement to increment column value
Please consider following setup Increment sequence with +1 for sequence >= sequence of cont2 and for respective Group The result should be Can any one help me to construct a SQL query to get above result? Answer I think this does what you want:
How to update columns only if argument is equal to specific value?
I have query that should update columns only if argument is equal 1. Here is example: I would like to move this SQL query to stored procedure. How I can achive the same process with SQL code only? Instead of <cfif form.status eq 1> title = @title,</cfif> how that can be replaced with SQL code? I use Sybase database and
How to truncate real, Money or decimal values in sybase database
I have a database function called: dbo.cf_unpaid_interest_to_date CREATE FUNCTION dbo.cf_unpaid_interest_to_date(@payment_plan guid_no_default) returns REAL AS BEGIN declare @runningdate datetime …
Sybase ASE 15 Aggregate Function for strings
I’am findind a way to aggregate strings from differents rows into a single row in sybase ASE 15. Like this: Something like FOR XML PATH in T-SQL. Thanks! Answer Sybase ASE does not have any string aggregate functions like list() or group_concat(); and while there is some support for FOR XML, it does not include support for the PATH option/feature.
Get current time without Date
How do I get the current time only? Gives me: I want this result: Answer You can convert the GETDATE() results to a TIME datatype to pull the current time:
How can I prevent Quickbooks from changing the “DatabaseName” parameter inside the database .DSN file?
This “.DSN” file is re-created by Quickbooks every time no user is connected. I’m trying to configure an ODBC connection using “SQL Anywhere” driver, one of the mandatory parameters needed for the …