hai experts i have a table called product in sql anywhere database which have a column of barcode-id of datatype varchar(15) and have the following values ie, 8 rows barcode_id UT10000 UT10001 UT10002 UT10003 UT10004 UT10005 UT10006 UT10007 when run a sql query like below Select barcode_id from product where barcode_id=:UT10001 and no of rows=:4 I want to get following values barcode_id UT10001 UT10001 UT10001 UT10001 ie, 4 rows if no.of rows = 10 then 10 rows of same barcode_id should be viewed How to achieve this through sql in sql anywhere database? regards kumar |
You can use the sa_rowgenerator() system procedure to generate a specified number of rows and then do a CROSS JOIN with your desired result set, such as: select P.barcode_id from product P cross join sa_rowgenerator(1, <parameter2>) where P.barcode_id = <parameter1> many thanks Volker barth, it works exactly what I want
(11 Oct '18, 02:47)
ghkumarchd
Comment Text Removed
|
I didn't understand the question, probably you were typing from your handy. But you should look at sa_rowgenerator.