sql - Unable to create a table using query -



sql - Unable to create a table using query -

i trying write query selects view.

create view carrentalhistoryview select c.vehno, c.brand, c.dateregistered, c.purchaseprice, c.rentalcost, c.condition 'before condition', r.condition 'after condtion', r.daterented, r.datereturned, r.custno,cu.name, cu.id, cu.dateofbirth dbo.car c inner bring together dbo.rental r on c.vehno = r.vehno inner bring together dbo.customer cu on cu.custno = r.custno; go

this query trying run,

select * dbo.carrentalhistoryview 'before condition' != 'after condition'

but query runs fine if case

select * dbo.carrentalhistoryview 'before cion' != 'after ction'

so point beingness how can ensure can results of vehicles has different status before. tks!

single quotes (') denote character literals. square braces ([]) denote columns names. view creation should like:

create view carrentalhistoryview select c.vehno, c.brand, c.dateregistered, c.purchaseprice, c.rentalcost, c.condition [before condition], r.condition [afterc ondtion], r.daterented, r.datereturned, r.custno, cu.name, cu.id, cu.dateofbirth dbo.car c inner bring together dbo.rental r on c.vehno = r.vehno inner bring together dbo.customer cu on cu.custno = r.custno ; go

now, can query properly:

select * dbo.carrentalhistoryview [before condition] != [after condition]

sql tsql

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -