sybase

Group consecutive rows that are incremented by 1

时光总嘲笑我的痴心妄想 提交于 2020-01-16 04:10:10
问题 Here are my datas : FirstKey SecondKey Sequence A1 B1 10001 A1 B1 10002 A1 B1 10003 A1 B1 10004 A1 B2 10001 A1 B2 10003 A1 B2 10005 A1 B3 10001 A1 B3 10002 A1 B3 10003 A2 B4 20001 A2 B5 20002 A2 B5 20003 A2 B6 20004 I try to output the following result: FirstKey SecondKey StartSequence EndSequence A1 B1 10001 10004 A1 B2 10001 10001 A1 B2 10003 10003 A1 B2 10005 10005 A1 B3 10001 10003 A2 B4 20001 20001 A2 B5 20002 20003 A2 B6 20004 20004 Sequence is an integer, not a varchar. I want

Group consecutive rows that are incremented by 1

三世轮回 提交于 2020-01-16 04:10:09
问题 Here are my datas : FirstKey SecondKey Sequence A1 B1 10001 A1 B1 10002 A1 B1 10003 A1 B1 10004 A1 B2 10001 A1 B2 10003 A1 B2 10005 A1 B3 10001 A1 B3 10002 A1 B3 10003 A2 B4 20001 A2 B5 20002 A2 B5 20003 A2 B6 20004 I try to output the following result: FirstKey SecondKey StartSequence EndSequence A1 B1 10001 10004 A1 B2 10001 10001 A1 B2 10003 10003 A1 B2 10005 10005 A1 B3 10001 10003 A2 B4 20001 20001 A2 B5 20002 20003 A2 B6 20004 20004 Sequence is an integer, not a varchar. I want

Cannot open Interactive sql from command prompt

余生长醉 提交于 2020-01-15 11:23:48
问题 I have added my own procedure to run as soon as user logs, using SET OPTION PUBLIC.post_login_procedure = 'xxx.Myprocedure'; I need to set custom message on pop up this provides when user logs in. The pop up is working, when I manually login in from Sybase central. however, when I run dbisql -c "DSN=myDSN" from command prompt Interactive sql opens and I get the popup that stays on forever! I cannot post images yet but I can send u one, it says "Connecting to database.." I get this pop up only

Cannot open Interactive sql from command prompt

て烟熏妆下的殇ゞ 提交于 2020-01-15 11:23:29
问题 I have added my own procedure to run as soon as user logs, using SET OPTION PUBLIC.post_login_procedure = 'xxx.Myprocedure'; I need to set custom message on pop up this provides when user logs in. The pop up is working, when I manually login in from Sybase central. however, when I run dbisql -c "DSN=myDSN" from command prompt Interactive sql opens and I get the popup that stays on forever! I cannot post images yet but I can send u one, it says "Connecting to database.." I get this pop up only

Cannot open Interactive sql from command prompt

孤者浪人 提交于 2020-01-15 11:23:11
问题 I have added my own procedure to run as soon as user logs, using SET OPTION PUBLIC.post_login_procedure = 'xxx.Myprocedure'; I need to set custom message on pop up this provides when user logs in. The pop up is working, when I manually login in from Sybase central. however, when I run dbisql -c "DSN=myDSN" from command prompt Interactive sql opens and I get the popup that stays on forever! I cannot post images yet but I can send u one, it says "Connecting to database.." I get this pop up only

How to delete duplicate rows in sybase, when you have no unique key?

僤鯓⒐⒋嵵緔 提交于 2020-01-15 03:35:06
问题 Yes, you can find similar questions numerous times, but: the most elegant solutions posted here, work for SQL Server, but not for Sybase (in my case Sybase Anywhere 11). I have even found some Sybase-related questions marked as duplicates for SQL Server questions, which doesn't help. One example for solutions I liked, but didn't work, is the WITH ... DELETE ... construct. I have found working solutions using cursors or while-loops, but I hope it is possible without loops. I hope for a nice,

How to delete duplicate rows in sybase, when you have no unique key?

主宰稳场 提交于 2020-01-15 03:35:06
问题 Yes, you can find similar questions numerous times, but: the most elegant solutions posted here, work for SQL Server, but not for Sybase (in my case Sybase Anywhere 11). I have even found some Sybase-related questions marked as duplicates for SQL Server questions, which doesn't help. One example for solutions I liked, but didn't work, is the WITH ... DELETE ... construct. I have found working solutions using cursors or while-loops, but I hope it is possible without loops. I hope for a nice,

Update model (edmx) with system tables (SYS.xxx) - Sybase

送分小仙女□ 提交于 2020-01-07 02:23:30
问题 When selecting 'update model from database' none of the system tables (SYS. schema) is available from the list of tables. How may I add a system table to my EF model. Sybase (ASA12) is the database platform which I am using. 回答1: As a workaround I created a view on the system table. It is then available and may be updated automated by the edmx generator 回答2: I created a script that recreates all the catalog views, i.e. sys.*, as views in a user schema: Note: This is T-SQL, and SQL Server

Add Row number to a new column

旧巷老猫 提交于 2020-01-07 01:20:07
问题 I want to create a new column and populate the value of each row in that column with the row number. This could be achieved in oracle by doing this. alter table mytable add (myfield integer); update mytable set myfield = rownum; How would this be done in SYBASE ASE? 回答1: alter table mytable add id bigint identity not null That's all. There will be a column id in every row that contains a unique sequence number for that row. 回答2: create column table some_names (ID bigint not null primary key

SQL query to get primary keys for all tables in sybase ase 15.x along with column names

[亡魂溺海] 提交于 2020-01-06 23:43:07
问题 I'm using Sybase ASE 15.5 and a stranger to this database. Straight to the point--> I'm looking for a sql query that would help me get the primary keys for all tables in sybase along with the column names on which the primary key is declared. For example, if I have the following tables, organization having primary key PK_org_id on the column org_id org_alias having primary key PK_alias_id on the column alias_id org_temp having primary key PK_org_temp_id on the columns (org_id,org_name) then