M
M
Muxauko2020-05-03 17:06:54
go
Muxauko, 2020-05-03 17:06:54

How to make a selection from the database and compose a string?

Please help with a solution.
I have a sqlite3 database with a user table.
The rows in the table look like this:
id number status
1 2987526 1
2 9725927 1 3 3925272
0
4 7896551 1 5 8926725
1 6 7829652
0

The task itself which number=7896551

Next, you need to compose a certain string astra , which lists the received numbers separated by commas :

var astra string
...
fmt.Println(astra)

> 2987526, 9725927, 8926725

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-05-03
@dimonchik2013

write your option and what does not work?
the question about the query in general can not be set
WHERE status= 1 and number not in (7896551)
or
WHERE status= 1 and number <> 7896551
or

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question