0

INSERT INTO PartyTable (Name ,City ,Department ,Age ,Gender ,Transport ,Food ,Drink) VALUES ('Ido', 'Ramla', 'management', '17', 'M', NULL, NULL, 'Vodka' 'Water');

i need the vodka and water in same box when it displayed it show VodkaWater instead Vodka Water

2
  • 1
    but your question is so trivial, did you attempted to search? Dec 10, 2016 at 15:24
  • 1
    I'm voting to close this question as off-topic because it isn't about software testing.
    – user246
    Dec 10, 2016 at 15:32

1 Answer 1

-1

If you want to concatenate the strings when reading from the DB, you should do it with a select:

SELECT Food + Drink as FoodDrink FROM PartyTable;

It will return only on column, called FoodDrink, where each row is the concatenation of the Food and Drink columns for each row in PartyTable.

2
  • It really depends on DBMS. In Oracle that would be SELECT Food || Drink as FoodDrink FROM PartyTable;
    – dzieciou
    Dec 10, 2016 at 23:35
  • The point is the semantics. If the syntax is different, anyone can change it. Dec 10, 2016 at 23:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.