C
C#2y ago
moshimoshi

✅ Why wont these SQL queries work?

Creating a userview - this works.
CREATE VIEW GoodCustomer
AS SELECT CustomerID, CustomerName,
MemberCategory,CountryCode
FROM Customers
WHERE MemberCategory IN (‘A’,’B’)
CREATE VIEW GoodCustomer
AS SELECT CustomerID, CustomerName,
MemberCategory,CountryCode
FROM Customers
WHERE MemberCategory IN (‘A’,’B’)
Update userview - doesnt work
UPDATE GoodCustomer
SET MemberCategory = ‘C’
WHERE CustomerID = 1000
UPDATE GoodCustomer
SET MemberCategory = ‘C’
WHERE CustomerID = 1000
Insert userview: - doesnt work
INSERT INTO GoodCustomer (CustomerID,
MemberCategory, CountryCode)
VALUES ( ‘5000',’C’, ‘USA' )
INSERT INTO GoodCustomer (CustomerID,
MemberCategory, CountryCode)
VALUES ( ‘5000',’C’, ‘USA' )
4 Replies
Jimmacle
Jimmacle2y ago
"doesn't work" is not specific
moshimoshi
moshimoshiOP2y ago
Can I ask for this query in SQLite: I have created a view successfully called Customer1998. When I run this query
SELECT * FROM customer1998;
SELECT * FROM customer1998;
it gives me this error: Result: no such table: main.order details How can i Resolve this?
moshimoshi
moshimoshiOP2y ago
Regarding this, is this becoz of the view-defining condition?
moshimoshi
moshimoshiOP2y ago
Ah i managed to resolve this!!
Want results from more Discord servers?
Add your server